PDA

View Full Version : IsoMax program does not work


grandvazir
12-12-03, 01:00 PM
Hi,

I am trying to input a value on the serial port and based on that value making the red led go on and off. the code is given below. it doesnt work though.. can anyone help??

VARIABLE REDCHAR
HEX
MACHINE WATCHSCI0
ON-MACHINE WATCHSCI0
APPEND-STATE WAITCHAR

IN-STATE WAITCHAR
CONDITION SCI0 RX?
CAUSES SCI0 RX REDCHAR C!
REDCHAR C@ SCI0 TX
REDLED TOGGLE
THEN-STATE WAITCHAR TO-HAPPEN


WAITCHAR SET-STATE
INSTALL WATCHSCI0
EVERY 20 CYCLES SCHEDULE-RUNS WATCHSCI0

nmitech
12-12-03, 03:04 PM
The result of the CONDITION SCI0 RX? is always false, Therefore no CAUSE to happen. I am not sure exactly what you want to do in the condition statement?

grandvazir
12-12-03, 03:20 PM
In the condition statement,
i want to poll the SCI0 receiver for any character that is available on the SCI and based on whether a character is available on SCI0 , i need to do further processing.

nmitech
12-12-03, 04:05 PM
Let me take it back. Actually Your program is working. Each time a key is hit, a character is echoed, and the red led is toggled. Is that what you want?

grandvazir
12-15-03, 01:05 PM
Hi,
the above program was not working earlier.
i removed a blank space after SCI0 RX? in the code
CONDITION SCI0 RX?
and bingo .. it started working