ADC on Atmega328. Part 2

After we’ve learned how to performs simple ADC conversions on AVR microcontroller we can move forward with more complex tasks. AVR ADC module has many useful features that make conversions more robust without occupying MCU resources.

Imagine that we need to sample analog waveform or audio signal. It has to be done precisely at defined sampling frequency like 20kHz. The only way to do this correct is to use auto-triggering with exact time intervals. Why not to pass counting task to timer? Lets write Timer0 auto triggered ADC conversions with ADC complete interrupt service routine. Read more »

PIC software SPI driven nokia 5110 LCD

Nokia 5110 graphical lcd is convenient to use because of SPI interface. So it is one of favorite LCDs in embedded projects. Following project is a interfacing example of this LCD to PIC16F84 microcontroller.

The problem is that this PIC microcontroller lacks SPI interface so there is only one way to drive this LCD – use software based SPI communications. Source code is written in ASM language. So C lovers may find it tricky to use. In other hand ASM has a big advantage versus C in small MCUs. So you’re free to choose.

Open source energy monitoring system

This is fully featured energy monitor based on Atmega328 microcontroller which is compatible with Arduino IDE. It is based on JeeNodeV5 for easy expandability. Device has two CT monitoring channels that reads electricity consumption by using energy CT sensors. Also it is features with pulse counting input that can read water or gas meter optically or from direct output.

emonTX has a dedicated port for 1-wire DS18B20 temperature sensor input. As these are stackable so it can read multiple sensors from single line. Energy meter can be battery powered so it can be attached anywhere and communicate wireless nanode that accepts data and publishes online via pachube service.

ADC on Atmega328. Part 1

Microcontrollers are meant to deal with digital information. They only understant ’0′ and ’1′ values. So what if we need to get some non digital data in to microcontroller. The only way is to digitize or simply speaking to convert analog in to digital. This is why almost all microcontrollers are featured with ADC module. Atmega328 microcontroller also have 8 (or 6 in PDIP package) ADC input channels.

All these can be used to read any analog value that is within reference voltage range.

Lets see how this is easy. Read more »

Next Page »