Archive

Archive for the ‘AVR’ Category

Arduino GPS

August 27, 2007 Pari 3 comments

Just to get my hands dirty and wrap it up with the AVR’s, I created a GPS data logger – using an Arduino board, GPS receiver chip, 4×20 LCD, and a uALFAT microSD board.

A good document on NMEA commands and data formats used by GPS chips is here. Regarding the GPS unit, it was SiRF vs Trimble, and I went for SiRF, the SiRF III (the EM-406A by USGlobalSat). I picked it over the Trimble Lassen IQ and the Parallax.

Of course you can buy a GPS data logger board with LCD for about $200. But the whole point is that it’d be a learning exercise, an interesting one :-).

I decided to write it in raw C (UART driver, LCD driver, flash data logger,…) instead of Arduino’s Wiring language. This amounts to pretty much reading most of the 300 page data sheet for the MCU, giving you a thorough understanding of all aspects of the MCU – GPIO, clocks, counters, interrupts, UART, SPI, I2C,… all related considerations like registers, masks, timings, memory organization,…

(photo updated, 12/2007).

Categories: AVR

Arduino LCD

August 25, 2007 Pari Leave a comment

Interfaced a 4×20 character LCD panel to the Arduino. Details on interfacing any Hitachi HD44780 based LCD panel can be found here.

I went for the default parallel LCD’s. They’re cheap, about $15 for a 20×4 panel on eBay (HD44780). The serial ones cost about 2-3 more. These LCD panels allow you to use 4 data lines (with some bit-banging) instead of 8. Get one that is STN and transflective (vs reflective and transmissive), known for better contrast and brighter.

Check out also LCDProc.

Categories: AVR

The Arduino

August 24, 2007 Pari Leave a comment

Just got it today :-) More than anything, the Arduino is a great learning platform for anyone interested in the embedded world. The entire platform is open (hardware schematics, bootloader, lots of examples, etc.).

Arduino comes with a nice language that abstracts out lot of the bit-level stuff. But for learning purposes I’d recommend just using C – i.e. to get right down to the metal to get to know the AVR. Ubuntu has a nice ready-made GNU C toolchain for the AVR which works quiet well. There is also an Eclipse plugin. You’ll probably end up reading two-thirds of the 350 page ATmega168 specs… but very worthwhile. Once you’ve done one, you’re all set to handle any 8-bit MCU. I found Atmel’s AVR docs are very well done, complete with assembly language and bit-level C-language code snippets.

Also, check this site out: Atmel AVR Application Notes. Tons of stuff. You don’t really need to buy any embedded systems books. The stuff here plus the Atmel AVR 8-bit Instruction Set set document should be all that you need.

Categories: AVR

ATmega128

August 22, 2007 Pari 2 comments

The Atmel ATmega128 AVR is a nice little full featured 8-bit MCU. It is as good as it gets among general purpose MCU’s (i.e. not including MCU’s which add on a host of other features like controllers for LCD, USB, Ethernet MAC, DSP, MMU, etc.).

For my own quick reference:

Feature ATmega128 ATmega168 ATmega8
Flash 128K 16K 8K
SRAM 4K 1K
512
EEPROM 4K 1K
512
UART 2 1
1
8-bit Timer 2 2
2
16-bit Timer 2 1
1
PWM (channels) 6+2 5
3
10-bit A/D (channels)
8 6
8
DebugWire/OCD Y -
-
Analog - Y
-
JTAG Y -
-
SPI 1 1
1
TWI 1 1
1
Categories: AVR