To check if there is any data RS232 serial buffer it must be read, returning 0xFF when there is no data.
This 0xFF impact on USART console data, making it impossible to use. To improve the usage of the UART component, I would like to propose an approach similar to Arduino, where a FIFO (size defined on property) is defined to receive data, allowing the reading on main loop. It will simplifies the implementation.
The RXINT interrupt handling will implemented only on more complex firmware, and it should be set on property.
Another issue is a specific console (to receive and transmit) for communication components, showing TX e RX data with different colors. Injectors are not practical since we need to switch screens and there is no direct relation between what you sent and what you get.
Best regards,
Fernando
Improvements for RS232 serial component
Moderator: Benj
- 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: Improvements for RS232 serial component
Hello Fernando,
Thanks for the suggestions.
The use of a FIFO buffer would rely on the interrupt being switched on behind the scenes. I beleive this is how Arduino do it, it's certainly something we can consider adding as it would simplify things for a user not used to adding their own interrupt.
If you change the return type from 8-bit to 16-bit then timeout's should now return 256 and should not appear on the console so this might do what you need here.
Not sure what you mean re the injectors, could you elaborate further?
Thanks for the suggestions.
The use of a FIFO buffer would rely on the interrupt being switched on behind the scenes. I beleive this is how Arduino do it, it's certainly something we can consider adding as it would simplify things for a user not used to adding their own interrupt.
If you change the return type from 8-bit to 16-bit then timeout's should now return 256 and should not appear on the console so this might do what you need here.
Not sure what you mean re the injectors, could you elaborate further?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel