SX-KEY 3.2 SX\B 1.51 compiler bug ?
This attached code compiles fine with SX-KEY 3.1 and the older
version of SX\B but I get multiple errors with the new SX-KEY (3.2) and SX\B 1.51.
There are three IF statements and each one fails for different reasons.
Does anybody have any idea what is wrong?
Thanks in advance
Here is the code:
///////////////////////////
DEVICE SX28, OSCHS2, TURBO, STACKX, OPTIONX
FREQ 50_000_000
RX VAR RB.6
TX VAR RB.5
LED VAR RB.4
BAUD CON "T2400"
CR CON 13
LF CON 10
COMMAND_LED CON "L"
command VAR Byte
i VAR Byte
temp VAR Byte
regAddr VAR Byte ' register address (subs)
'
INTERRUPT
'
PROGRAM Start
ChecksumErrorMessage:
DATA "Error",CR,LF,0
RXBYTE SUB 1 ' rx from serial IO
TXBYTE SUB 1 ' tx to serial IO
SendErrorMessage SUB
Start:
TRIS_B = %11001111
LOW LED
Main:
RXBYTE @temp
' and see if it matches the received value
if temp <> 45 then
' an rx error occured
SendErrorMessage
Goto Main
ENDIF
IF command = COMMAND_LED then
if temp = "1" then
HIGH LED
ELSE
LOW LED
ENDIF
ENDIF
GOTO Main
RXBYTE:
regAddr = __PARAM1 ' save return address
SERIN RX, BAUD, temp ' receive a byte
__RAM(regAddr) = temp ' put byte into passed var
RETURN
TXBYTE:
temp = __PARAM1 ' save byte to send
SEROUT TX, BAUD, temp ' send the byte
RETURN
SendErrorMessage:
i = 0
SendNextChar:
READ ChecksumErrorMessage+i,temp
if temp <> 0 then
TXBYTE temp
i = i + 1
GOTO SendNextChar
ENDIF
RETURN
//////////////////////////
Post Edited By Moderator (Bean (Hitt Consulting)) : 9/8/2006 1:03:51 PM GMT
version of SX\B but I get multiple errors with the new SX-KEY (3.2) and SX\B 1.51.
There are three IF statements and each one fails for different reasons.
Does anybody have any idea what is wrong?
Thanks in advance
Here is the code:
///////////////////////////
DEVICE SX28, OSCHS2, TURBO, STACKX, OPTIONX
FREQ 50_000_000
RX VAR RB.6
TX VAR RB.5
LED VAR RB.4
BAUD CON "T2400"
CR CON 13
LF CON 10
COMMAND_LED CON "L"
command VAR Byte
i VAR Byte
temp VAR Byte
regAddr VAR Byte ' register address (subs)
'
INTERRUPT
'
PROGRAM Start
ChecksumErrorMessage:
DATA "Error",CR,LF,0
RXBYTE SUB 1 ' rx from serial IO
TXBYTE SUB 1 ' tx to serial IO
SendErrorMessage SUB
Start:
TRIS_B = %11001111
LOW LED
Main:
RXBYTE @temp
' and see if it matches the received value
if temp <> 45 then
' an rx error occured
SendErrorMessage
Goto Main
ENDIF
IF command = COMMAND_LED then
if temp = "1" then
HIGH LED
ELSE
LOW LED
ENDIF
ENDIF
GOTO Main
RXBYTE:
regAddr = __PARAM1 ' save return address
SERIN RX, BAUD, temp ' receive a byte
__RAM(regAddr) = temp ' put byte into passed var
RETURN
TXBYTE:
temp = __PARAM1 ' save byte to send
SEROUT TX, BAUD, temp ' send the byte
RETURN
SendErrorMessage:
i = 0
SendNextChar:
READ ChecksumErrorMessage+i,temp
if temp <> 0 then
TXBYTE temp
i = i + 1
GOTO SendNextChar
ENDIF
RETURN
//////////////////////////
Post Edited By Moderator (Bean (Hitt Consulting)) : 9/8/2006 1:03:51 PM GMT
Comments
What errors do you get ?
I just compiled the code with SX/B 1.51.01 and it compiled fine.
Try installing the 1.51.01 update from here http://forums.parallax.com/showthread.php?p=597707
There were some bug fixes, maybe the problem is corrected.
P.S. You should have the INTERRUPT keyword commented out, or else put a RETURNINT right after it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
There are only two guaranteed ways to become weathy.
Spend less than you make.
Make more than you spend.
Post Edited (Bean (Hitt Consulting)) : 9/8/2006 2:11:19 PM GMT
Updating to SX\B 1.51.01 did the trick.
Stange that the "What's new" didn't mention anything that looked related to the problems I was seeing.
Thanks for your help.
Dave
Glad that worked for you.
Sometimes a "fix" will correct problem that haven't been discovered when the new version is released.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
There are only two guaranteed ways to become weathy.
Spend less than you make.
Make more than you spend.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!