Yup, it's clearly labeled with the Hitachi name and the 44780 part number. > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On > Behalf Of stef mientki > Sent: Sunday, June 10, 2007 6:04 PM > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] Interfacing to a Hitachi 44780 LCD in 4-bit mode > > Matthew Mucker wrote: > > All, > > > > I've been debugging this problem for weeks and haven't found where my > error > > is, so I'm turning to the list for help. I'm trying to drive a > Hitachi 44780 > > LCD module in 4-bit mode from a PIC chip. > > > Are you sure you have a "real" 44780 ? > Anyway after using a lot of displays without any problems, > I got a VARITRONIX type which gave a lots of trouble. > An extra delay solved the problem, see code below. > > success, > Stef Mientki > > > > |-- -- - Extra delay in Init procedure, after 4-bits setting, > -- needed for VARITRONIX MDLS-16268-series > -- Problem was a uncomplete reset, after which the total > behaviour was instable > > || > const _HD44780_short_delay = 5| > > | > ||procedure LCD_init is > -- if multiplexed IO-pins, these values will be set just before > sending > if ! HD44780_multiplexed_output then > HD44780_b4_pin = low > HD44780_b5_pin = low > HD44780_b6_pin = low > HD44780_b7_pin = low > HD44780_DataCmd_pin = low > > HD44780_b4_direction = output > HD44780_b5_direction = output > HD44780_b6_direction = output > HD44780_b7_direction = output > HD44780_DataCmd_direction = output > end if > > HD44780_Enable_pin = low > HD44780_Enable_direction = output > > delay_1mS ( 40 ) -- even long enough for Vcc as > low as 2.7V > HD44780_DataCmd_pin = low -- select command > _HD44780_write_low_nibble ( 0b_0011 ) -- first init > delay_1mS ( 5 ) -- extra delay > _HD44780_write_low_nibble ( 0b_0011 ) -- second init > delay_10uS( 10 ) -- extra delay > _HD44780_write_low_nibble ( 0b_0011 ) -- third init > > _HD44780_write_low_nibble ( 0b_0010 ) -- set 4-bit interface > delay_10uS( _HD44780_short_delay ) -- FOR SOME DISPLAYS > (VARITRONIX) required delay > _HD44780_Command( 0b_0010_1000 ) -- two lines, 5x7 (high nibble) > _HD44780_Command( 0b_0000_1111 ) -- display on, cursor on, blink > on > _HD44780_Command( 0b_0000_0001 ) -- clear display > _HD44780_Command( 0b_0000_0110 ) -- increment and no shift > > -- now display version of this lib > delay_1ms(100) > LCD_char_pos ( "V", 1) > LCD_char_pos ( " ", 2) > LCD_char_pos ( "1", 3) > LCD_char_pos ( ".", 4) > LCD_char_pos ( "4", 5) > end procedure > | > > > I have my PIC 16F628 connected to the LCD module as follows: > > > > RB4 --> LCD_E > > RB3 --> LCD_RS > > RA0 --> LCD_D4 > > RA1 --> LCD_D5 > > RA2 --> LCD_D6 > > RA3 --> LCD_D7 > > > > I have tested each of these outputs and verified that I can write a > logic > > '1' or '0' and get the expected voltage. > > > > I've used Myke Predko's page (www.myke.com/lcd.htm) as my main > reference. > > > > According to MPLAB SIM, my code is writing the following when the > LCD_E line > > is blipped: > > > > LCD > > DATA LCD > > TIME 7654 RS notes > > > > 0 0011 0 send 0x03, wait 5msec > > 5.1964 0011 0 send 0x03, wait 160 usec > > 5.5218 0011 0 send 0x03 a third time, wait 160 usec > > 5.8472 0010 0 Enable 4-bit mode (following commands are > > two nybbles) > > 6.0126 0010 0 > > 6.1766 1000 0 00101000: 4-bit mode, 2 line display, 5x7 > > font > > 6.3248 0000 0 > > 6.5068 1000 0 00001000: disp. Off, cursor off, blink > off > > 6.6730 0000 0 > > 6.8370 0001 0 00000001: clear display, wait > > 12.0356 0000 0 > > 12.1996 0110 0 00000110: increment cursor/no shift > > 12.3658 0000 0 > > 12.5298 1100 0 00001100: display on, cursor off, blink > off > > 12.6968 0000 0 > > 12.8608 0010 0 00000010: home cursor > > 18.0618 0101 1 > > 18.2258 0111 1 Letter 'W', first character to be > displayed > > > > The LCD doesn't seem to initialize and for sure my characters aren't > being > > displayed. I'm getting quite frustrated with this project. I'm hoping > > someone out there can spot the error of my ways for me and help me > get back > > on the straight and narrow. > > > > Thanks, > > > > -Matt > > > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist