amateur_24
Member
Hi
This LCD is compatible with the HD4780 however it won't display anything at all. I'm using a 20 MHZ crystal which is running at 20 - 20.02 MHZ. I setup the avr to use an high frequency external crystal with highest startup.
I'm using a library from Peter Fleury Home page Peter Fleury's Home Page.
I've tried grounding the RS,RW and enable lines but it still won't display anything. i Have double checked my wiring. I'm using a atmega16P chip.
Right now all I have is black squares on the top row and 2nd to last row when I turn the contrast. I did turn the contrast down but I don't see anything.
The library is only 4 bit so I used the last 4 bits on the lcd i.e. d4-d7
It's a 20*4 row LCD.
https://www.electro-tech-online.com/custompdfs/2011/03/0900766b80f25f62.pdf
#define XTAL 20000000 /**< clock frequency in Hz, used to calculate delay timer */
The firmware is the example that come with the library
This LCD is compatible with the HD4780 however it won't display anything at all. I'm using a 20 MHZ crystal which is running at 20 - 20.02 MHZ. I setup the avr to use an high frequency external crystal with highest startup.
I'm using a library from Peter Fleury Home page Peter Fleury's Home Page.
I've tried grounding the RS,RW and enable lines but it still won't display anything. i Have double checked my wiring. I'm using a atmega16P chip.
Right now all I have is black squares on the top row and 2nd to last row when I turn the contrast. I did turn the contrast down but I don't see anything.
The library is only 4 bit so I used the last 4 bits on the lcd i.e. d4-d7
It's a 20*4 row LCD.
https://www.electro-tech-online.com/custompdfs/2011/03/0900766b80f25f62.pdf
#define XTAL 20000000 /**< clock frequency in Hz, used to calculate delay timer */
PHP:
/**
* @name Definition for LCD controller type
* Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller.
*/
#define LCD_CONTROLLER_KS0073 0 /**< Use 0 for HD44780 controller, 1 for KS0073 controller */
/**
* @name Definitions for Display Size
* Change these definitions to adapt setting to your display
*/
#define LCD_LINES 4 /**< number of visible lines of the display */
#define LCD_DISP_LENGTH 20 /**< visibles characters per line of the display */
#define LCD_LINE_LENGTH 0x16 /**< internal line length of the display */
#define LCD_START_LINE1 0x00 /**< DDRAM address of first char of line 1 */
#define LCD_START_LINE2 0x40 /**< DDRAM address of first char of line 2 */
#define LCD_START_LINE3 0x14 /**< DDRAM address of first char of line 3 */
#define LCD_START_LINE4 0x54 /**< DDRAM address of first char of line 4 */
#define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */
#define LCD_IO_MODE 1 /**< 0: memory mapped mode, 1: IO port mode */
#if LCD_IO_MODE
/**
* @name Definitions for 4-bit IO mode
* Change LCD_PORT if you want to use a different port for the LCD pins.
*
* The four LCD data lines and the three control lines RS, RW, E can be on the
* same port or on different ports.
* Change LCD_RS_PORT, LCD_RW_PORT, LCD_E_PORT if you want the control lines on
* different ports.
*
* Normally the four data lines should be mapped to bit 0..3 on one port, but it
* is possible to connect these data lines in different order or even on different
* ports by adapting the LCD_DATAx_PORT and LCD_DATAx_PIN definitions.
*
*/
#define LCD_PORT PORTC /**< port for the LCD lines */
#define LCD_DATA0_PORT LCD_PORT /**< port for 4bit data bit 0 */
#define LCD_DATA1_PORT LCD_PORT /**< port for 4bit data bit 1 */
#define LCD_DATA2_PORT LCD_PORT /**< port for 4bit data bit 2 */
#define LCD_DATA3_PORT LCD_PORT /**< port for 4bit data bit 3 */
#define LCD_DATA0_PIN 0 /**< pin for 4bit data bit 0 */
#define LCD_DATA1_PIN 1 /**< pin for 4bit data bit 1 */
#define LCD_DATA2_PIN 2 /**< pin for 4bit data bit 2 */
#define LCD_DATA3_PIN 3 /**< pin for 4bit data bit 3 */
#define LCD_RS_PORT PORTD /**< port for RS line */
#define LCD_RS_PIN 4 /**< pin for RS line */
#define LCD_RW_PORT PORTD /**< port for RW line */
#define LCD_RW_PIN 5 /**< pin for RW line */
#define LCD_E_PORT PORTD /**< port for Enable line */
#define LCD_E_PIN 6 /**< pin for Enable line */
The firmware is the example that come with the library
Last edited: