16×2 LCD and PIC 18F4550 – electroSome https://electrosome.com/topic/16x2-lcd-pic-18f4550/feed/ Sat, 18 Mar 2023 04:53:39 +0000 https://bbpress.org/?v=2.6.9 en-US https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12675 <![CDATA[16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12675 Mon, 11 Jul 2016 13:08:28 +0000 b0rg Hi,

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.

Thanks

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12680 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12680 Mon, 11 Jul 2016 14:59:05 +0000 Ligo George Are you sure that it is working with another LCD library ?

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12681 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12681 Mon, 11 Jul 2016 15:05:07 +0000 b0rg Yes, as I said in the first post, it works with another library.

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12682 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12682 Mon, 11 Jul 2016 15:18:27 +0000 Ligo George Are you sure that your PIC microcontroller is oscillating fine ? Just check with LED blinking first and also try replacing PORTBbits with LATBbits.

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12683 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12683 Mon, 11 Jul 2016 15:44:21 +0000 b0rg 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 ?

Thanks

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12684 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12684 Mon, 11 Jul 2016 15:49:35 +0000 b0rg 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?

 

thanks

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12686 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12686 Mon, 11 Jul 2016 16:00:52 +0000 Ligo George 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.

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12687 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12687 Mon, 11 Jul 2016 16:03:56 +0000 b0rg 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.

 

 

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12688 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-12688 Mon, 11 Jul 2016 16:43:56 +0000 Ligo George Then try using internal oscillator.

]]>
https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-13446 <![CDATA[Reply To: 16×2 LCD and PIC 18F4550]]> https://electrosome.com/topic/16x2-lcd-pic-18f4550/#post-13446 Mon, 30 Jan 2017 05:48:23 +0000 John Jason Hi,

I did experience this before, perhaps you should try CodeOffset to 1000 and see if that works (In your programming software)

Hope that helps!

John

]]>