MOD5282 UART

Discussion to talk about hardware related topics only.
Post Reply
tpannone
Posts: 69
Joined: Fri Feb 15, 2013 1:04 pm

MOD5282 UART

Post by tpannone »

This sounds like a stupid question, but can someone tell me the max baud rate the MOD5282 UARTs will support? I'm searching through all my documentation and don't see any numbers listed anywhere. I'm planning on interfacing it with a serial AHRS which can support up to 921600 baud. I'm thinking that the MOD5282 should at least be able to do 115200 baud.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: MOD5282 UART

Post by TomNB »

The serial baud rate calculation is on page 23-18 of the 5282 processor manual. The system clock is 66MHz. Using the system clock as the baud rate generator, the 5828 can hit all standard rates up to 230,400. Beyond that the percent error created by dividing the system clock will be too high for the standard ones.

An alternative would be to use a clock just for the baud rate, in which case you can hit higher numbers. The external clock comes in on one of the DTIN pins. That is described on the same manual page. But there is also a baud rate vs actual throughput issue. How the program is written as well as the processor speed will determine if you could handle a 921600 baud rate at full throughput speed (not being flow controlled off). My recommendation would be to check the performance at 230400 first.
tpannone
Posts: 69
Joined: Fri Feb 15, 2013 1:04 pm

Re: MOD5282 UART

Post by tpannone »

Thanks @TomNB. I ran into the problem you noted in the first paragraph when I plugged 921600 into the baud rate calculation. I really hadn't planned on trying to run at 921600 anyway, but knowing that I can run as high as 230400 using the system clock is very good to know.
tpannone
Posts: 69
Joined: Fri Feb 15, 2013 1:04 pm

Re: MOD5282 UART

Post by tpannone »

@TomNB. Just wanted to give you an update. The MOD5282 UART did not have any issues interfacing with my serial AHRS at 230400. The AHRS had an output data rate of 100Hz. We were shooting for a data rate of 200Hz, but unfortunately I cannot increase the data rate of the AHRS beyond 100Hz without increasing the baud rate. The next baud rate step is 460800.

I'll look into adding an external clock for the baud rate generator, but modifying our MOD5282 carrier board was not in current our plans.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: MOD5282 UART

Post by TomNB »

Hello tpannone,

Thank you for the update. Just out of curiosity, is there any AHRS h/w that can run a SPI interface? I don't know much about AHRS, but SPI runs significantly faster. Although this won't help with your current project, I ran some percent error calculations on our ARM M7 module, and came up with 0.15% for both 460800 and 921600. That is because the baud rate generator has a fractional divider. Unfortunately, the 5282 does not. Sorry about that.
tpannone
Posts: 69
Joined: Fri Feb 15, 2013 1:04 pm

Re: MOD5282 UART

Post by tpannone »

Sorry @TomNB for taking so long to reply about the AHRS sensor. The rugged version we are using only supports RS-232 and Serial TTL. The surface mount chip version supports those two plus SPI. At this point though, there are no plans on modifying our 5282 carrier board. Plus the ability to mount the sensor remotely from the 5282 is desirable.

So far the only issue I'm having is that baud rates over 115200 is causing other routines in the 5282 from running. This is even with lower data rates from the sensor. For example, I'm sampling 8 channels of analog data with an 8 channel, 12-bit A2D. The 5282 reads the A2D via SPI 100 times a second. At 115200 baud with a 40Hz output from the sensor, I am getting good data on the A2D channels. If I bump up the baud rate to 128000, I stop getting data on the A2D channels.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: MOD5282 UART

Post by TomNB »

In a pre-emptinve RTOS, the highest priority task ready to run will run. So if you have multiple tasks, the architecture of the application might be starving a lower priority task. The speeds you mention (100Hz SPI and 40Hz UART) don't seem that bad, so I wouldn't think you would be running out of horsepower. Maybe you doing some processing on the data that takes a long time? Floating point would be time consuming on that platform.
tpannone
Posts: 69
Joined: Fri Feb 15, 2013 1:04 pm

Re: MOD5282 UART

Post by tpannone »

Thanks @TomNB. My serial routine priority is 59, so there's not much lower than that. And we're not doing any other processing like floating point within the 5282. Testing is inconclusive at the moment. With 40Hz @ 128000 baud, sometimes I can read the A2D channels and sometimes I can't.
tpannone
Posts: 69
Joined: Fri Feb 15, 2013 1:04 pm

Re: MOD5282 UART

Post by tpannone »

Hi @TomNB. I made a mistake earlier. My SPI loop is running at 400HZ not 100Hz. The 100Hz loop is the UDP transmit rate to our controller PC.

I'm beginning to think the problem is with my serial reception routine. It works great at lower baud and data rates that you'd find with NMEA-0183 strings. I'm thinking that I need to break my routine into two processes. One low priority process that receives data from the UART and stuffs it into a FIFO. The second higher priority process reads the FIFO, does the checksum calculation and data parsing, and packages it for UDP transmission to our controller PC.
Post Reply