Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Asynchronous serial data with 115200 bit/sec

Posted by Jonas Poulsen on September 4, 2009
Hi
I know this is not the first time this topic has been discussed, so please forgive me.

I am working with FreeRTOS 5.2.0 on a NEC 78K0R-KG3 (12 kb RAM/ 256 FLASH / ~14 MHz) in preemptive mode with approx. 5 tasks. FreeRTOS is brilliant – easy to work with and stable!

My device interfaces another device using the built-in UART running 115200 bit/sec. Unfortunately I have no flow control available (neither sw./hw.) so I am really struggling to find a solution so I do not lose characters in my Rx interrupt. I believe the enter/exit critical section in for instance vTaskDelay (calls xTaskResumeAll() ) can take longer than the approx. 80 us I have between my incoming characters.

I have two onboard DMA controllers that can help me, but I have a total of 4 UARTS that I may, or may not, want to use in 115200 bit/sec.

Can anyone confirm that there is no easy way to solve this type of problem, other than using either DMA or implementing some kind of flow control.

Best regards,

Jonas, Denmark

RE: Asynchronous serial data with 115200 bit/sec

Posted by Peter on September 4, 2009
Hi Jonas,
try to define the uart interrupt priority higher than all rtos related tasks. So the uart isr can interrupt the scheduler. Within the interrupt write the received character into a receive buffer (FIFO). Back in your task you can access the buffer.
Could be that a solution?

RE: Asynchronous serial data with 115200 bit/sec

Posted by Jonas Poulsen on September 4, 2009
Hi Peter
I have prioritized my UART RX interrupt at the highest possible level, but the problem is that interrupts are completely disabled when FreeRTOS execute some operations. No matter how the UART RX interrupt is prioritized it will not be executed....

/Jonas

RE: Asynchronous serial data with 115200 bit/sec

Posted by Jonas Poulsen on September 5, 2009
** Update **
I have implemented a work-around using the two onboard DMA controllers, but I am still wondering if their is another solution.

BR,
Jonas

RE: Asynchronous serial data with 115200 bit/

Posted by Dave on September 5, 2009
I would not call that a work around but the reason why the DMA is provided in the first place and what is expected to be done.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists