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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.