Page 1 of 1

UART reads taking an excessive amount of time

Posted: Thu Jun 01, 2017 4:25 pm
by Zane
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.
8 Bit.jpg
8 Bit.jpg (24.53 KiB) Viewed 3644 times

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.
32 Bit.jpg
32 Bit.jpg (28.36 KiB) Viewed 3644 times


Thanks

Zane

Re: UART reads taking an excessive amount of time

Posted: Fri Jun 02, 2017 2:21 pm
by LeighM
Thanks, sorry, I read this last night, then forgot to pick it up today.
I'll take a look.

Re: UART reads taking an excessive amount of time

Posted: Fri Jun 02, 2017 3:16 pm
by LeighM
Could you please try with the attached FCD?
Thanks,
Leigh
32MX270F256B.fcdx
(53.11 KiB) Downloaded 85 times

Re: UART reads taking an excessive amount of time

Posted: Tue Jun 06, 2017 8:58 am
by Zane
Hi Leigh,

Thanks for your efforts. I have a fair bit on but will have time to look at this on Thursday and will get back in touch to let you know how it goes. :D

Thanks

Zane

Re: UART reads taking an excessive amount of time

Posted: Thu Jun 08, 2017 7:29 am
by Zane
Hi Leigh,

I tried this update and it works fine now. Thanks for your help

Zane

Re: UART reads taking an excessive amount of time

Posted: Thu Jun 08, 2017 8:12 am
by LeighM
Thanks for testing and letting me know