July 11, 2016 at 6:38 pm #12675
I’m trying to interface 16*2 LCD with pic18f4550 using the code in attachment. I checked the pins and they are declared correctly alsoI’m using 8Mhz external crystal. I also checked one other LCD library which seems to be working, however when using this code I’m getting 1st row black squares like something hasn’t been initialized properly.
Any input would be really great.
Attachments:You must be logged in to view attached files.July 11, 2016 at 8:29 pm #12680
Are you sure that it is working with another LCD library ?July 11, 2016 at 8:35 pm #12681
Yes, as I said in the first post, it works with another library.July 11, 2016 at 8:48 pm #12682
Are you sure that your PIC microcontroller is oscillating fine ? Just check with LED blinking first and also try replacing PORTBbits with LATBbits.July 11, 2016 at 9:14 pm #12683
Hi, thanks for the answer. I did first run a LED test, and it works fine, perhaps a bit faster than expected so I also suspect that it is probably oscillator settings, but I can’t find whats wrong in config.h. I did set FOSC = HS in order to use external crystal. Did I miss something ?
ThanksJuly 11, 2016 at 9:19 pm #12684
LATBbits did the black squares trick. However some of the text on the LCD is garbage. for example http://www.electrosome.com looks like elec7roume.6m.
This is still frequency problem?
thanksJuly 11, 2016 at 9:30 pm #12686
It can be frequency problem, noise problem etc. Try reduce the wire length to LCD if you are using long wires and also try adding more filtering capacitors.July 11, 2016 at 9:33 pm #12687
Hi. Something else lets me believe that its more probable to be code problem rather than hardware. When I tried it with the other LCD library but using internal oscillator (4 mhz input) it did work properly with multiple line outputs. But with this code it outputs some garbage. Will have to check datasheet again for the oscillator settings.July 11, 2016 at 10:13 pm #12688
Then try using internal oscillator.
You must be logged in to reply to this topic.