Hello!
I'm currently implementing Modbus RTU into my nRF52832 to enable the CPU to communicate with other Modbus RTU capable devices.
When communicating via Modbus RTU it's necessary to detect if the transmission of data from the other device to mine has been completed.
To do this there is a timeout timer which resets after every character received.
With a baudrate of 19200 and 11 bits per character a new character is being received just about every 572 microseconds.
With a maximum baudrate (defined by our other modbus capable device the nRF52832 should talk to) of 115200 this value goes down to 95 microseconds.
Naturally, this seems to be way too fast for the app_timer module to stop and restart a timer, the timer action queue fills up and after receiving a bunch of data I always and up with a NRF_ERROR_NO_MEM error.
How would you suggest that I should implement such a quickly resetting timer?
I'm currently using the app_timer module and the following lines of code are how I reset the timer
APP_ERROR_CHECK(app_timer_stop(timer_t35)); APP_ERROR_CHECK(app_timer_start(timer_t35, APP_TIMER_TICKS(T35_FOR_19200_MS), NULL));
Thanks for taking the time!
Michael