UART reads taking an excessive amount of time
Posted: Thu Jun 01, 2017 4:25 pm
Hi Ben,
I have found a problem when reading the UART that it takes an excessive amount of time. The chip i am using that i am having problems with is a 32MX270F256B.
I have driven two outputs, one is connected to the brown trace and monitors the cycle time of the main loop, toggling every program cycle. The red trace is in the interrupt routine that is activated when UART receives data. The output turns on at the start of the routine and is turned off at the end of the routine.
I have used the same program in each instance, running one on a 18F26K80 and the results are shown below. To read a byte from the UART takes 64uS. After this the program reverts back to processing the main loop again until the next byte is availablein approx 1ms time. The other is when it is run on a 32MX270F256B. To read a byte takes just over 1mS. The main loop is not processed at all until the serial port becomes idle again. Thanks
Zane
I have found a problem when reading the UART that it takes an excessive amount of time. The chip i am using that i am having problems with is a 32MX270F256B.
I have driven two outputs, one is connected to the brown trace and monitors the cycle time of the main loop, toggling every program cycle. The red trace is in the interrupt routine that is activated when UART receives data. The output turns on at the start of the routine and is turned off at the end of the routine.
I have used the same program in each instance, running one on a 18F26K80 and the results are shown below. To read a byte from the UART takes 64uS. After this the program reverts back to processing the main loop again until the next byte is availablein approx 1ms time. The other is when it is run on a 32MX270F256B. To read a byte takes just over 1mS. The main loop is not processed at all until the serial port becomes idle again. Thanks
Zane