RS232/USART Parity, Stop bits & Interrupts

Moderator: Benj

Post Reply
Penguin Fach
Posts: 4
Joined: Fri Feb 19, 2010 11:26 am
Contact:

RS232/USART Parity, Stop bits & Interrupts

Post by Penguin Fach »

It would be a huge advantage to have Flowcode able to handle parity and stop bits if required. With asynchronous comms, a single stop bit is handled by the microcode within the USART and is invisible to the user. This is not the case if 2 stop bits are used. This is often required for application compatibility. Of course this can be handled by user code but the resulting data cannot be correctly viewed in the sent, received and queued windows. For example, if you have data that is 7 data bits and 2 stop bits, if you receive 8-bit data the MSB will always be a '1' corresponding to the additional stop bit. Thus the ASCII character 'q' would appear as '±'. While the user can of course use the software option for 7-bit data, all the advantages of the USART are lost.

It would also be an advantage to add support for the 'TX complete' interrupt that is available on many processors. This interrupt is particularly useful when sending long data streams. Apart from overall baud rate error, aperiodic variation in the gap between individual data packets in long asynchronous transmission of several hundred bytes is one of the most common causes of data stream error and the use of the TX interrupt significantly reduces this.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RS232/USART Parity, Stop bits & Interrupts

Post by Benj »

Hello,

The custom code feature of Flowcode v4 allows you to tailor the component to match your requirements. Eg you could change the code to check the most significant bit. If it is set then we have valid data and the bit can then be automatically cleared ready for use in your application.

Post Reply