All the heavy lifting is done by AVRlib, a great library with lots of helpful libraries for driving external hardware.
Beware, there is a very similarly named library AVR-Libc, which also looks good.
I'm driving the LCD in "Port interface" mode and using the 4 bit data mode. As speed isn't important for my application I've chosen to save the extra 4 dataport pins.
Here's my config from lcdconf.h:
#define LCD_PORT_INTERFACE
// Enter the parameters for your chosen interface'
// if you chose the LCD_PORT_INTERFACE:
#ifdef LCD_PORT_INTERFACE
#ifndef LCD_CTRL_PORT
// port and pins you will use for control lines
#define LCD_CTRL_PORT PORTD
#define LCD_CTRL_DDR DDRD
#define LCD_CTRL_RS 2
#define LCD_CTRL_RW 3
#define LCD_CTRL_E 4
#endif
#ifndef LCD_DATA_POUT
// port you will use for data lines
#define LCD_DATA_POUT PORTD
#define LCD_DATA_PIN PIND
#define LCD_DATA_DDR DDRD
// access mode you will use (default is 8bit unless 4bit is selected)
#define LCD_DATA_4BIT
#endif
#endif
My wiring for the pins on the LCD circuit board is as follows:
- Vss 0V
- Vdd 5V
- Contrast Pot 10K wiper
- RS - C2
- R/W - C3
- Enable - C4
- D0 No Connection
- D1 No Connection
- D2 No Connection
- D3 No Connection
- D4 - D4
- D5 - D5
- D6 - D6
- D7 - D7
- No Connection
- No Connection
Many thanks Pascal Stang!
1 comment:
hi everybody,
i m beginner in avr section well i m trying to interface atmega8535 with hd44780 please help me with very basic example for that my email tarunkanda2000@yahoo.com thanks for ur blog sharing these sort of things.
Post a Comment