LCDs speak in ASCii. The PBP3 Reference Manual covers ASCii on pages 42 & 305-6. To work with decimal, add 48 to your decimal value & it should appear on the LCD screen as the value intended.
LCDs speak in ASCii. The PBP3 Reference Manual covers ASCii on pages 42 & 305-6. To work with decimal, add 48 to your decimal value & it should appear on the LCD screen as the value intended.
There is an initialization process to get LCDs to come on line. It usually isn't needed, but I ran into an instance like yours where everything suggested it SHOULD work, but it didn't. One of the HD44780 LCD Data Sheets outlined an initialization process. Here is what I use:
4-Wire
For 8-wire:Code:Init_LCD: RS = 0 ' LCD = $20 DB7 = 0 DB6 = 0 DB5 = 1 DB4 = 0 En = 1 pauseus 10 En = 0 pause 5 ' LCD = $20 DB7 = 0 DB6 = 0 DB5 = 1 DB4 = 0 En = 1 pauseus 10 En = 0 pauseus 160 ' LCD = $20 DB7 = 0 DB6 = 0 DB5 = 1 DB4 = 0 En = 1 pauseus 10 En = 0 pauseus 160 LCD = $28 gosub Send LCD = $10 gosub Send LCD = $0C gosub Send LCD = $06 gosub Send LCD = 1 gosub Send pause 1 LCD = $80 gosub Send RS = 1 pause 1 RETURN
Maybe this will help.Code:Init_LCD: low RS PORTB = $30 high En pauseus 4 low En pause 5 PORTB = $30 high En pauseus 4 low En pauseus 160 PORTB = $30 high En pauseus 4 low En pauseus 160 PORTB = $38 gosub Send PORTB = $10 gosub Send PORTB = $0C gosub Send PORTB = $06 gosub Send PORTB = 1 gosub Send pause 1 PORTB = $80 gosub Send high RS pause 1 RETURN Send: high En pauseus 8 low En pause 1 return
given all things working display wise ,imho mike is leading you astrayThe blinking LED on the transmitting PIC is working, and the LCD on the receiving PIC is working, but I'm not seeing any numbers being displayed.
tx unit:-
send = send + 1
hserout [send]
will send binary 0 to 9 , probably not the best idea but it is workable
ps weird baud rate
rx unit:-
hserin [dec data_in]
pause 5
will never work
1. its waiting for ascii numbers , the first non number will terminate routine
2. pause 5 why it serves no purpose and can cause framing errors
add this define
DEFINE HSER_CLROERR 1 ' Clear overrun error upon execution of every HSERIN command
rx unit:-
lcdout $fe, $94, dec data_in
if ok but it needs
hserin [data_in] to match data types
ps weird baud rate
Last edited by richard; - 10th May 2018 at 06:09.
Warning I'm not a teacher
Bookmarks