Page 1 of 1

RS232 coponent rx character simulation

Posted: Tue Jan 26, 2010 12:36 am
by Brian Walsh
The RS232 component has three windows. The characters sent window seems self explanatory. Where can I find a comprehesive explanation of how to use the characters in queue / characters received windows?

Using the + button when the simulation is running opens a window which adds characters to the queue window but the only way I've found to transfer characters to the received window is to stop and re-start the simulation whereupon one character is transferred to the component.

Is there a way to simply type characters at the keyboard for input to the simulation.

tia,

Brian.

Re: RS232 coponent rx character simulation

Posted: Tue Jan 26, 2010 9:38 am
by Benj
Hello Brian

Characters can be added to the RS232 queue by running the simulation and clicking the + button. If your program is a loop that performs a RS232 read each cycle then on each RS232 read macro you should move a character through from the queue to the received window.

If no characters were received by the RS232 then you will get a return value of 255. Therefore you can check for this using a decision to let you know if you have received any data or not.

Re: RS232 coponent rx character simulation

Posted: Tue Jan 26, 2010 9:50 am
by Sean
Hello Brian,

Characters are transferred from the queue window to the receive window as they are read by the RS232 receive macros. This is a true representation of how the system would operate, especially if hardware handshaking is implemented.

Characters remaining in the queue have not been read by a corresponding read macro, but remain active and can be read by subsequent macro calls.

Characters in the received window are no longer active. This is simply a record of the characters that have been processed.

The queue system allows multi-character strings to be created (useful in many applications) before being submitted.

Re: RS232 coponent rx character simulation

Posted: Thu Jan 28, 2010 12:48 am
by Brian Walsh
Thanks for the replies guys.

There is no RS232 receive in my main loop. The main loop simply flashes an LED. There is an RS232 receive in the preamble, which was suggested by one of you, to clear any error conditions. When I run the simulation it is this call to the component macro which moves the first character from the queue into the pseudo usart and the received characters window.

The preamble also enables an interrupt which calls a macro containing another RS232 component call and it is the behaviour of this ISR that I am trying to debug.

So, having started the simulation and witnessed the RS232 component in the preamble move the first character from the queue into the psuedo usart and received character window, how do I force remaining characters out of the queue and into the pseudo usart to test the interrupt response.

tia,

Brian.

Re: RS232 coponent rx character simulation

Posted: Thu Jan 28, 2010 8:16 am
by Steve
Simulation of the timer interrupt is quite slow, so you could try reducing the interrupt period. If you are using an RX interrupt, then this is currently not simulatable.