Hi again I hope someone will look at this post and help me with my problem. I have reduced the code to a minimum but it still runs for about a minute then crashes.
Any help most wecome
thanks again John
'pic18f2525
DEFINE OSC 8
OSCCON = %11111111
DEFINE LOADER_USED 1 ' Comment out if not using boot-loader
INCLUDE "modedefs.bas"
TXBAT var word
Volt1 var word
SIGN VAR BYTE
B0 VAR BYTE
B0 =100
SIGN = 1
VOLT1 = 2222
TXBAT = 90
' ----------------------------------------------------------------------------
' MAIN lOOP
' ----------------------------------------------------------------------------
Loop:
GOSUB Transmit
GOSUB SerialInput
GOTO Loop
' ----------------------------------------------------------------------------
' Get Serial Input to serial port 9600 baud inverted
' ----------------------------------------------------------------------------
Serialinput:
SerIn2 portC.7,16468,1000,loop,[wait ("FMS"),dec3 B0]
RETURN
' ----------------------------------------------------------------------------
' Get Load Value and output to serial port 9600 baud inverted WITH - SIGN
' ----------------------------------------------------------------------------
Transmit :
SEROUT2 PortC.6,16468,["SIGN",#SIGN,"LOADX",#volt1,"BATY",#TXBat,"SIGN",#SIGN,"LOADX",#volt1,"BATY",#TXBat,"SIGN",#SIGN,"LOADX",#volt1,"BATY",#TXBat]
RETURN
Bookmarks