try with APFCON0.2 = 1, because the chip is initialized with TX on the RC4 pin, (APFCON0.2 = 0), so you must change it. datasheet page 123.
try with APFCON0.2 = 1, because the chip is initialized with TX on the RC4 pin, (APFCON0.2 = 0), so you must change it. datasheet page 123.
Thanks and Regards;
Gadelhas
The Scott Edwards display is expecting Inverted serial levels.
The USART puts out True levels by default.
Add this setting ...Code:BAUDCON.4 = 1 ; Transmit inverted data to the TX/CK pin
DT
Thanks Darrel! It works now except the LCD shows a strange character in the 1st position (looks like "F1" with the "1" being a subscript).
Code:#IFDEF USE_LCD_FOR_DEBUG HSEROUT [LCD_INST, LCD_CLR] pause 5 HSEROUT ["DutyVar1=", DEC DutyVar1, 13, 10] ' Send text followed by carriage return and linefeed #ENDIF Main: ADCIN 1, adval if adval <> oldDutyVar1 then oldDutyVar1 = adval DutyVar1 = adval #IFDEF USE_LCD_FOR_DEBUG HSEROUT [LCD_INST, LCD_CLR, LCD_L1] HSEROUT ["DutyVar1=", DEC DutyVar1, " ", 13, 10] ' Send text followed by carriage return and linefeed #ENDIF EndIf Pause 100 Goto Main
You need at least a 2mS pause after the clear screen command.HSEROUT [LCD_INST, LCD_CLR, LCD_L1]
Then you need another LCD_INST before the LCD_L1.
Or just leave out the LCD_L1 since the clear screen leaves the cursor on line 1.
Last edited by Darrel Taylor; - 14th January 2013 at 14:52.
DT
I have a 5ms pause before the Main loop, but I think it's irrelevant since the ADCIN gets a value which is immediately different than the set value for DutyVar1 (set to 0 earlier in the code) and hence it goes straight into the IF block.
I'll add a 5ms pause in the IF block, too. And remove the LCD_L1 if it's not needed.
Thanks again, Darrel!
Bookmarks