cancel
Showing results for 
Search instead for 
Did you mean: 

Using 5 UARTs at the same time

jprinster
Associate II
Posted on September 30, 2011 at 00:08

I am using an STM32F103ZE but could switch to a different model.

I need to have all five UARTs running at the same time to receive data from different peripherals.  Originally I was thinking of having 5 ISRs to handle the incoming data on a single byte basis.  However, given the volume of incoming data over each port I am concerned the frequency of interrupts for each byte could be too much.  My understanding of using the DMA would help for only two ports.  Does anyone have a suggestion how to handle receiving a high volume of data from all of the UART ports and not get bogged down by too many interrupts? 

Would switching to the STM32F2x series allow me to use DMA to a FIFO on all five UARTS?

Thanks.

#divide-and-conquer
4 REPLIES 4
Posted on September 30, 2011 at 01:41

I'd have to check your exact part (pins/package), but the some of STM32F103ZE family (FLASH 512KB/RAM 64KB) are certainly capable of 3 USART Tx/Rx DMA (USART1,2,3 via DMA1), as I've tried that. And I'm also pretty sure DMA2 permits supports USART4, but that's probably a 105 or 107 part. Why don't you review the datasheets?

Personally, I'm not excited about the ST USART implementation, I'd be tempted to slap a couple of external quad-uart parts with proper HW FIFO implementations into the design.

Also from personal experience I would commit USART1 to being the programming/debug port.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
infoinfo989
Associate III
Posted on September 30, 2011 at 06:05

You might want to think about changing to an STM32F2xx part. That way you'll get a lot more CPU cycles to handle the ISRs. Or the DMAs, whichever way you prefer to run it. There's a person I know of locally who's using a 2x part for exactly that reason - to be able to use all the UARTs on the part.

Posted on September 30, 2011 at 08:57

''the volume of incoming data over each port''

 

 

So what, exactly, is the volume of incoming data? And its speed?

Can any of your peripherals support flow control?

Posted on September 30, 2011 at 10:23

Rather than just have 1 Big STM32 trying to do everything itself, might it be better to go multi-processor and have a few, ''smaller'' processors handling (some of) the work...?