I'll have to look at ADCON1 -- maybe it doesn't influence Port A -- who knows.
I'll have to look at ADCON1 -- maybe it doesn't influence Port A -- who knows.
I hope you know the pic16"C"72 is a one time programmable pic vs. pic16"F"72. So you only get one shot to make it work. Also a common beginner's LCD problem is the contrast control.
contrast is fine.
I have a few thousand 16c72.
just a beginner with LCDOUT. It's using default ports is something you don't think of.
Ok, I give up. Hours spent on this. Maybe someone could be so kind as to look at the code and see why this doesn't function. Something simple perhaps. I realize the 16C72 is an antiquated part but I have a ton of them. I even used another LCD (yes hd44780's) -- even tried another xtal etc. Mclr is high to Vdd, ADCON1 is making pins digital. Changed the defaults because A4 isn't TTL on the 16C72 so used B7 and C7 for RS and E to avoid conflicts -- even did a TRIS on all the pins. Power supply is fine -- this is crazy.
DEFINE OSC 4 '16C72
ADCON1 = 7
TRISA = %00000000
TRISB = %00000000
TRISC = %00000000
DEFINE LCD_DREG PORTA
DEFINE LCD_DBIT 0 'a0 thru a3
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 7
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 7
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
Pause 1000 ' Wait for LCD to startup
mainloop:
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "Hello" ' Display Hello
Pause 500 ' Wait .5 second
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "World"
Pause 500 ' Wait .5 second
Goto mainloop ' Do it forever
End
Last edited by Michael; - 10th June 2017 at 23:49.
and for what it's worth all I get are a group of 16 squares on the 2nd line
Last edited by Michael; - 10th June 2017 at 23:50.
do you have the unused data pins 4 to 7 tied to gnd along with the r/w pin ?
Warning I'm not a teacher
I think that should bedo you have the unused data pins 4 to 7 tied to gnd along with the r/w pin ?
do you have the unused lcd data pins 0 to 3 tied to gnd along with the r/w pin ?
can't remember don't use them much . point is the pins should not be left floating
Warning I'm not a teacher
The only difference I can see between your example code and the code I use for LCD in my projects is that my code has
After the definition for LCD_LinesCode:DEFINE LCD_COMMANDUS 2000 ' Command delay time in us DEFINE LCD_DATAUS 50 ' Data delay time in us
I always use PORTB as I have an EasyPIC development board and that's the default wiring for the LCD, so can't comment on using pins on other ports for the enable / reset lines, but in theory, if they are set to digital it should be OKCode:DEFINE LCD_DREG PORTB ' LCD Data port DEFINE LCD_DBIT 0 ' starting Data bit (0 or 4) DEFINE LCD_EREG PORTB ' LCD Enable port DEFINE LCD_EBIT 5 ' Enable bit (on EasyPIC 5 LCD) DEFINE LCD_RSREG PORTB ' LCD Register Select port DEFINE LCD_RSBIT 4 ' Register Select bit (on EasyPIC 5 LCD) DEFINE LCD_BITS 4 ' LCD bus size (4 or 8 bits) DEFINE LCD_LINES 4 ' number of lines on LCD DEFINE LCD_COMMANDUS 2000 ' Command delay time in us DEFINE LCD_DATAUS 50 ' Data delay time in us
Bookmarks