Close

PIC16F1786 now working with standard 16x2 LCD

A project log for Universal Glucometer

Did your test strips just get more expensive? Has the drug store run out of strips for YOUR meter? Like to be able to use any test strip?

tom-meehanTom Meehan 07/02/2016 at 04:060 Comments

It took me a bit of trial and error but I finally got a standard 16x2 LCD display to function with my target chip (PIC16F1786).

First I had to figure out the pin connections from the LCD to the PIC.

Initially I tried utilizing the same pins used in the Microchip reference design. It wasn't quite that easy, of course. Then I thought - maybe the logic is reversed for the RS pin - so I changed it in the lcd_1.h file. Still no luck. Finally I dug into the datasheet for the PIC16F877A to see what the RD port functions were (turns out it is a parallel port register). Then I looked at the datasheet for the PIC16F1786 to see what ports had a similar function, not as easy as I thought. In the end I decided to try using another pin from the RC register (that is not used in the reference design), changed my "#defines" in my program to correspond... and Eureka it worked.

The "lcd_1.h" file I used came from electrosome.

Discussions