|
Greetings all,
I have wrote a program which uses the HSERIN/HSEROUT commands to communicate with a rather touchy serial-based LCD display. The issue that I am running into now is that the program I have developed only works on the Nano-40; when I use the program on a Nano-18 either nothing is displayed or an single "A" is displayed.
I know that from the manual that there is a differences for hardware pins which I have made adjustments for; I am left wondering if there are some issues between the Nano-40 vs. the Nano-18 that are not listed in the manual. I have include the major part of my code for others to review. Thanks for any insight that anyone can offer.
; ******************************************************************************** ; ** Thermostat Control Program ; ** ; ** Processor: Basicmicro Nano-18 ; ** Temperature Sensor/Floor: LM34CAZ ; ** Temperature Sensor/Air: ; ** LCD Display: 4D Systems ; ** Wireless Interface: XBee Series 1 ; ** ; ** ; ** ; ** LCD Display Connections to the Nano-18 ; ** Reset: Pin-16 of Nano-18 (P13-General Purpose Pin) ; ** TX: Pin-8 of the Nano-18 (P2-AUSART RX Pin) ; ** RX: Pin-11 of the Nano-18 (P5-AUSART TX Pin) ; **
RST CON 13 ;Pin-16/Connected to Reset Pin of the LCD Display ATPIN CON 8 ;Pin-17/Connected to Air Temperature Sensor FTIN CON 9 ;Pin-18/Connected to Floor Temperature Sensor
ATVAL VAR LONG FTVAL VAR LONG AIRTEMP VAR FLOAT FLRTEMP VAR FLOAT LCDSTAT VAR WORD
CLEAR ;Reset all variables to zero
LCDSTAT=65
SETHSERIAL1 H9600
SEROUT S_OUT,I9600,[0] SEROUT S_OUT,I9600,["------------------------",13] SEROUT S_OUT,I9600,["Resetting LCD....",13]
PAUSE 500 GOSUB LCDRESET
SEROUT S_OUT,I9600,["Display an A....",13] HSEROUT [$54,$41,$01,$01,$FF,$FF] GOSUB NAK
SEROUT S_OUT,I9600,["Display Text Room Temp....",13] HSEROUT [$73,$00,$02,$03,$FF,$FF,"Room Temp:",$0] GOSUB NAK
SEROUT S_OUT,I9600,["Display Text Floor Temp....",13] HSEROUT [$73,$00,$03,$03,$FF,$FF,"Floor Temp:",$0] GOSUB NAK
SEROUT S_OUT,I9600,["Display Text Floor Temp....",13] HSEROUT [$73,$00,$04,$03,$FF,$FF,"Floor-1 Temp:",$0] GOSUB NAK
SEROUT S_OUT,I9600,["Display Text Floor Temp....",13] HSEROUT [$73,$00,$09,$03,$FF,$FF,"Floor-2 Temp:",$0] GOSUB NAK
END
; ** Process to reset the LCD/Send Autobaud Command ** LCDRESET LOW RST PAUSE 1000 HIGH RST PAUSE 1000 SEROUT S_OUT,I9600,["Sending AUTOBAUD command....",13] HSEROUT [$55] ;Send AUTOBAUD command GOSUB NAK GOSUB NAK RETURN
; ***********************************************************
; ** Process to clear the LCD Screen LCDCLR SEROUT S_OUT,I9600,["Clearing the LCD Screen....",13] HSEROUT [$45] ;Send CLEARSCREEN command GOSUB NAK
RETURN
NAK HSERIN [LCDSTAT] IF LCDSTAT=$15 THEN SEROUT S_OUT,I9600,["Command Error:",DEC LCDSTAT,13] ENDIF IF LCDSTAT=6 THEN SEROUT S_OUT,I9600,["Command OK:",DEC LCDSTAT,13] ELSE ;SEROUT S_OUT,I9600,["Command returned: ",DEC LCDSTAT,13] SEROUT S_OUT,I9600,["Command returned: ",13] ENDIF RETURN
|