In SX Microcontrollers, SX/B Compiler and SX-Key Tool, descott wrote: 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 ////////////////////////// ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=143734 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)