LCD 16*2 powertip, electronic or programming problem, please help

Hi all,
(Before all… Sorry for my so poor english…)

The Story:
4 weeks ago I have started a project to put some options in my old little car (cruise control, automatic ligthing, and so on). My system work with a tiny PC board linked with a vellemann K8055 usb i/o board and other things (lot of sensors, motors and a beautifull backlighted pc1602 lcd module.
On begining I have used a GDM1601 (xiamen ocular). The 1601 dont comes with a B/L and I have made it with some micro leds and some backlight filters.
I have found a wiring schematic and a base program (in VB) and the screen has worked fine some days.

The problem:
When I have rewired the lcd with longer wires, the lcd dont work anymore. I have rewired the ldc with shorter cable with identical result.
After hours of test I have saw that the lcd work but nothing is visible with a normal viewpoint. After two days trying tons of things I have decided that the lcd was dead! lol! I have ordered a new lcd from farnell. My new lcd is PC1602 instead 1601 and is b/l.
For first I have connected the new lcd whith my VB base pgm and tuto and it is the same! changing some commands I obtain clear beautifull display but the language displayed seem to be… Martian? Venusian? Dont know!

I have downloaded others tutos, datasheets, programs, Holly bibles, etc…

Additionnal infos:
Because my new screen is a dual line display I have changed the initialisation command (0x2 : 4 bits, 1 line)
When I use 0x2 with the dual line I obtain correct caracter set but output is unreadable due to very poor contrast.
When I use 0x28 with the dual line I obtain … Nothing!
When I use 0x4 or 5 or 6 I obtain perfect contrast but unknown caracter set!

Anyone have an idea?

Thanks for reading me!

Marco

attached:

  • Wiring diagram
  • First LCD output using 0x4 instead of 0x2
  • new LCD output using 0x4 instead of 0x4

Montage_LCD.jpg

DSCF9466.JPG

DSCF9476.JPG

DSCF9479.JPG

I obtain clear beautifull display but the language displayed seem to be… Martian? Venusian? Dont know!

The results that you get may be incorrect but they can provide clues to the problem. Without knowing what information you were trying to display, along with what incorrect results were actually displayed we have no idea. My guess is that it is some sort of wiring error that just happens to permit proper initialization of the LCD yet fouls up the display of some ASCII codes.

Don

Please post a picture of what the display looks like with these wierd characters on it.

It is, as floresta says, most likely a wiring error. I presume that the characters are not printing in the right places either.

Thanks thanks thanks! For reading and writing!

I have just modified my first post in order to get you more infos. I have reordered and added some pictures.

The output in the third image is obtained trying to write the string : "09/02/2011 12:xx"

Thanks a lot!

Hmm, that's not quite what I was expecting but it is still most likely a data line issue or something.

Have you triple checked your wiring? :)

I presume you have a datasheet somewhere for the module and then we could tell you exactly how it should be connected.

Thanks for continuing to write.

I have cheked wiring more times and tested positive and negatives wires (neg, neg/contrast, etc…) and that SEEMS to be ok.
I have downloaded and folowed instruction in the datasheets (PowerTip datasheet for 1602-h and standard HD44780U datasheet)

I think its important to note that my lcd is directly wired to lpt1 port of the PC not to a PIC board or specialized circuit.
I have tested with my VB base pgm and with an other CPP pgm with a litle bit different wiring but nothing happens and I have rewired all folowing the image attached to my first post.

Using initialisation command 0x4 instead of 0x2 i obtain stranges glyphes when i send a word the first time. I f i retry to write the same word again the entire content of the line move on the right like i write another space before the word and so on if i continue to send it.
?/x/??/xx…
becomes:
?/x/??/xx…
?/x/??/xx…
?/x/??/xx…
etc…

sob…

I try to find another program in VB or C/CPP writed to use the LCD using parallel port but i dont find.

CODE OF VB PGM (Most important routines):

'//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'// Initialisation de l'écran LCD (configuration LCD)
'//
'//  - Ici il est important de connaître les "instructions set"
'//    de votre afficheur LCD, car suivant le type d'LCD le jeu
'//    de commande diffère.
'//  - Ex: pour mon afficheur (PVC160101P) 1 ligne 16 caractères ci-dessous
'//  - En connaissant ces caractéristiques vous pourrez adapter
'//    des afficheurs LCD de différents types ou formats.
Sub LCD_Init()
    Out (LPTx), 0               ' Registre DATA =0 (D0,D1...D7) à ZERO (LPTx = Dec888, 0x378)
    Sleep 16                    ' On attend 16 ms pour que le LCD soit prêt

    'LCD_Commd (&H2)         'pour mon LCD Mode 4 bits , 1 lignes utilisées , taille des caractères
    LCD_Commd (&H28)       'pour LCD avec 2 lignes ex://$28 Mode 4 bits , 2 lignes utilisées , taille des caractères : 5x7
    LCD_Commd (&HC)         'Affichage activé , le curseur ne se voit pas
    LCD_Commd (&H6)         'Après chaque affichage , le curseur se déplace vers la droite
    LCD_Commd (&H1)         'On efface l'écran et on met le curseur en haut à gauche
End Sub

'//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'// ENVOYER UNE COMMANDE A L'ECRAN LCD
Private Sub LCD_Commd(Dat)
    Dat_Tmp = Dat And &HF0          ' Suppression des 4 bits poids faible
    Out (LPTx), Dat_Tmp             ' Envoyer les bits de poids fort sur D4 ==> D7
    LCD_Enable (Dat_Tmp)            ' Valider (E)nable LCD
    Dat_Tmp = Dat And &HF           ' Suppression des 4 bits poids fort
    Dat_Tmp = Dat_Tmp * 16          ' Et décalage poids faible => poids fort
    Out (LPTx), Dat_Tmp             ' Envoyer les bits de poids faible sur D4 ==> D7
    LCD_Enable (Dat_Tmp)            ' Valider (E)nable LCD
    
    Sleep 2                         ' ~Temps oblig pour validation de la commande
End Sub                             ' (de 40µs à 1.64ms suivant la commande (voir vos caractéristique LCD)

'//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'// ENVOYER UN CARACTERE A L'ECRAN LCD
Private Sub LCD_Chr(Dat)
    Dat_Tmp = Dat And &HF0          ' Suppression des 4 bits poids faible
    Dat_Tmp = Dat_Tmp Or 1          ' Activer (RS) LCD
    Out (LPTx), Dat_Tmp             ' Envoyer les bits de poids fort sur D4 ==> D7
    LCD_Enable (Dat_Tmp)            ' Valider (E)nable LCD
    Dat_Tmp = Dat And &HF           ' Suppression des 4 bits poids fort
    Dat_Tmp = Dat_Tmp * 16          ' Et décalage poids faible => poids fort
    Dat_Tmp = Dat_Tmp Or 1          ' Activer (RS) LCD
    Out (LPTx), Dat_Tmp             ' Envoyer les bits de poids faible sur D4 ==> D7
    LCD_Enable (Dat_Tmp)            ' Valider (E)nable LCD
End Sub

'//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'// ACTIVATION DE LA BROCHE (ENABLE) DE L'ECRAN LCD
Private Sub LCD_Enable(Dat1)
    Dat1 = Dat1 Or 2                ' Activer (E)nable LCD
    Out (LPTx), Dat1                ' Envoyer valeur sur registre DATA
For t = 1 To 100                    ' Tempo oblig pour valid Ennable
Next t
    Dat1 = Dat1 Xor 2               ' Désactiver (E)nable LCD
    Out (LPTx), Dat1                ' Envoyer valeur sur registre DATA
For t = 1 To 20000                   ' Tempo oblig pour valid Ennable
Next t
End Sub

instructions.jpg

reset auto func.jpg

What you could have posted is the back side of the display so we know which pin is pin 1. Also how is the display connected to your arduino is not shown in your pictures. If I connect the data lines wrong, I will get these things. The funny character is just inverted P.

Thanks for reply :slight_smile:

If you see the attached picture in my first post you will see how is wired the lcd. Pins in my second lcd are the same. 1 to 14. I have attached the pins description apart the B/L power (15 - 16) in this post.

But the thing that alert me is the fact that if I use exactly the command like it was a 1601 I will obtain good charset and functionality but the content will be pratically unreadable with a normal 6 O’clk viewpoint.

I have buyed special wires in order to test wiring more easily.

I will make some tests now…

pins.jpg

I think its important to note that my lcd is directly wired to lpt1 port of the PC not to a PIC board or specialized circuit.

Bit specialised for an Arduino forum ?

Looking through your posts, theres no mention of arduino, are you in the right place ?

I'd have a clue if it was wired to an Arduino, I've successfully done several.

Please find the power to pardon me. I have just understand that I'm on the wrong site. I do not have any arduino!

:blush: :blush: :blush: :blush:

Sorry for disturbing and thanks a lot for your helps!

Release the dogs! ]:)

Lol! :) :$

Perhaps you want to get an arduino :)

Mix78, if you like C, you will love arduino programming.

Show me where can I get arduino samples... I can get all the PIC samples that I want lol, but atmel dont even give a measly single chip..

Marco:

Check to see if data line D6 is stuck high.

Don

You can get samples of Atmel ATmega chips but not the popular ones that are commonly used for arduino boards. People have been testing bootloaders and core files on many of the Atmel chips though.

Anyway, if you abuse the samples system by just getting them to use them as single units, then in the future, samples won't be available.