I have a simple project that needs to monitor 5 sensors and communicate by highspeed serial to a master controller. Should be a piece of cake...
I have built a simple project based on Blinky with ThreadX. I put in two threads with UART communications framework. This could not keep up with two sensors periodically streaming data at 9600 baud. I had to enable DTC transfers for this to keep up. After I added DTC transfers and it was keeping up with the two sensors I added an I2C sensor using SSP drivers. Now I have lost one of the ascii sensors - same problem reported on the UART --- overflow all the time.
I am beginning to wonder if the S3A7 can carry ThreadX and frameworks. Do I need to go back to the stone ages and use a simple round robin control scheme?
My S3 should be running at 48Mhz per my clock setup in configurator. I am thinking that might be the problem. I ran a test and used a scope and a test point to measure execution time. A simple loop that incremented a 32 bit variable 100 times took 150 uSec. I looked at assembly code and that was 4 instructions per loop therefore it was about .375 uSec per assembly language instruction. I have no idea how many clock cycles per instruction but if it was 5 my clock would be 13 MHz.
Questions:
- Should my S3A7 be expected to run ThreadX with several threads using SSP frameworks?
- How do I tell if my clock is really 48Mhz?
Thanks your your feedback ...
Steve D