Hi there
i am trying to use serin to read a array of data from a UPS, at this stage i have used all the other serial ports, can someone give me a hint if there is a easer way instead of typing in the whole array , i have tried {str array/size} but get compile errors also my timeout does not want to work
Ann help would be appreciated
INCLUDE "MODEDEFS.BAS"
DEFINE OSC 20 ' Define crystal as 20Mhz
TRISE = %00000010
'Configure debug
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 2
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_MODE 0
UPS VAR BYTE[46]
MAIN:
DEBUG "MAIN PROGRAM",13,10
GOTO READUPS
DEBUG UPS[0],UPS[1],UPS[2],UPS[3],UPS[4],UPS[5],UPS[6],UPS[7],UPS[8],UPS[9],UPS[10],UPS[11],UPS[12],_
UPS[13],UPS[14],UPS[15],UPS[16],UPS[17],UPS[18],UPS[19],UPS[20],UPS[21],UPS[22],UPS[23],UPS[24],UPS[25],UPS[26],UPS[27],UPS[28],_
UPS[29],UPS[30],UPS[31],UPS[32],UPS[33],UPS[34],UPS[35],UPS[36],UPS[37],UPS[38],UPS[39],UPS[40],UPS[41],UPS[42],UPS[43],UPS[44],UPS[45],13,10
goto MAIN
READUPS:
DEBUG "READ UPS SUBRUTINE",13,10
SEROUT PORTE.0,T2400,["Q1",13]
SERIN PORTE.1,T2400,200,MAIN,[UPS[0],UPS[1],UPS[2],UPS[3],UPS[4],UPS[5],UPS[6],UPS[7],UPS[8],UPS[9],UPS[10],UPS[11],UPS[12],_
UPS[13],UPS[14],UPS[15],UPS[16],UPS[17],UPS[18],UPS[19],UPS[20],UPS[21],UPS[22],UPS[23],UPS[24],UPS[25],UPS[26],UPS[27],UPS[28],_
UPS[29],UPS[30],UPS[31],UPS[32],UPS[33],UPS[34],UPS[35],UPS[36],UPS[37],UPS[38],UPS[39],UPS[40],UPS[41],UPS[42],UPS[43],UPS[44],UPS[45]]
GOTO MAIN
END
Bookmarks