--===============0487882510== Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by pch.mit.edu id k8FFefQA014540 There is lots of stuff on this topic, and I have looked at lots, but I fi= nd=20 it bewilderingly inconsistent. Finally, I decided to use Microchip AN587 = as=20 my guide. I have assembler programmed an 18F452 to initialize a Powertip PC1602F 16= X2=20 display, which I believe to be compatible with the HD44780. I use the 4-b= it=20 interface. I have tested it by running power-up initialization, and then=20 sending a 'T'. However, it doesn't work, and I am really at a loss to kno= w=20 what is wrong. I wonder if anyone who has programmed such interfaces would mind having a= =20 look at the following overview of the operation of my code? An experience= d=20 person could perhaps spot immediately what may take me hours and hours to= =20 find (yes, I am a noob). Phil ************************************************************************* PC1602F LCD Display Module Initialisation ************************************************************************* I assumed that power on to the PC1602F does not comply with the specification for proper power-on reset. Therefore initialization by instruction is necessary. Procedure is as Microchip AN587. RS R/W DB7 DB6 DB5 DB4 Power on Wait 20mS Send 0 0 0 0 1 1 (0x03) =20 Function Set 8-bit I/F Wait 5mS Send 0 0 0 0 1 1 (0x03) =20 Function Set 8-bit I/F Wait 0.2mS Send 0 0 0 0 1 1 (0x03) =20 Function Set 8-bit I/F Wait 5mS Send 0 0 0 0 1 0 (0x02) =20 Function Set 4-bit I/F Wait 5mS >From here on commands are 2 nibbles in quick sequence Send 0 0 0 0 1 0 (0x02) =20 Function Set - Nibble 1 NO WAIT (strictly a few hundred nS) Send 0 0 1 0 0 0 (0x08) Nibb= le=20 2 - 4-bit I/F, = =20 2-line display, 5X7 chars. Wait 1mS Send 0 0 0 0 0 0 (0x00) Disp= lay=20 OFF - Nibble 1 NO WAIT (strictly a few hundred nS) Send 0 0 1 0 0 0 (0x08) Nibb= le=20 2 Wait 1mS Send 0 0 0 0 0 0 (0x00) =20 Display ON - Nibble 1 NO WAIT (strictly a few hundred nS) Send 0 0 0 1 0 1 (0x05) Nib= ble=20 2 Wait 1mS Send 0 0 0 0 0 0 (0x00) Ent= ry=20 Mode Set - Nibble 1 NO WAIT (strictly a few hundred nS) Send 0 0 0 1 1 0 (0x06) Nibb= le=20 2 - Incr cursor = =20 no display shift. Wait 1mS Now display is ready to receive characters. To test simply send a single character ('T'): Send 1 0 0 1 0 1 (0x25) MS=20 nibble - write 'T' NO WAIT (strictly a few hundred nS) Send 1 0 0 1 0 0 (0x24) LS=20 nibble - write 'T' _________________________________________________________________ Windows Live=99 Messenger has arrived. Click here to download it for free= !=20 http://imagine-msn.com/messenger/launch80/?locale=3Den-gb --===============0487882510== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 7bit -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --===============0487882510==--