PDA

View Full Version : Character Mode


tom@origtech.com
09-19-2008, 10:02 AM
When using the “character mode” on the input for UART 1 (ie API stdinMode(1, False)) when does the RF engine pass the received characters to the SNAPpy script?

I assumed that the configuration parameters: Buffering Timeout and Inter-character Timeout could be used to make sure that the engine waited till all of my characters were received and then pass on the complete string to my hook function.

Currently I have Buffering Timeout set to 5 and Inter-character Timeout set to 2. I am sending a character sting of 5 to 40 characters at 9600 baud to UART 1. Looking on a scope there are no pauses in the transmitted character string to the RF engine. Still I occasionally get the 5 to 40 character stings broken into two (never three) calls to the hook function. Is there any way to insure that I can have the compete message (all 5 – 40 characters) received in one hook function call. My data structure does not enable me to use character mode as the data being sent is binary.

tom@origtech.com
09-19-2008, 10:31 AM
After re-reading the definition of the Buffering timeout, I altered the value from 5 to 50 to allow the complete packet to be captured prior to being sent. Although not as many data packets were broken into seperate RF transmissions, I still have the event happen where the data packet is sent as two transmissions.

msellers
09-19-2008, 02:19 PM
What version of portal are you using? The latest 2.1.17 that includes snap 2.1.7 has an additional timeout that might help you but we only sample those input pins every 1msec so we might be missing some. If you have a bitstream to transfer that doesn't have a start bit and stop bit, we can't promise to have the horsepower to be a bit-wise transport.

tom@origtech.com
09-19-2008, 03:46 PM
I am using Portal 2.1.17 and Snap 2.1.7.

The data that I’m sending is a string of 8 bit asynchronous characters. Each character is composed of 8 bits with one start, one stop bit, and no parity. This would be similar to a printed ASCII string with the exception that all 256 bit patterns are valid in the message string and there is no end of line character. The end of the message is determined by a timeout..

After changing the Buffering Timeout from 5 to 50 I now am experiencing dropped characters from the string. The string received at the remote end does not have all of the character that were sent to the first unit. In addition now the missing characters are not being sent in a second RF packet, they are now being dropped. Changing the Buffering Timeout back to 5 does not seem to return the units to their prior state (i.e. The complete message was sent, i.e. no missing bytes, but sometimes split in to two packets).

What are the available timeouts parameters in version 2.1.7? I only know about the Buffering Timeout and Inter-character timeout.