UART communication

ose wrote on Saturday, August 18, 2018:

Hi, i am using the Arduino Uno with the ATMEGA328p microcontroller.
I wanna implement UART communication and i am not sure of the process when using freertos.
Doing uart communcation without freertos is no problem for me but with Freertos i dont know what functions to use.

I have done some reading and i went through the freertos pdfs and saw some examples but i am not very clear on them.

Please it would be great if i got some steps on how to go about it.

Thank you

rtel wrote on Saturday, August 18, 2018:

I don’t know how the UART works on the Arduino, but I suspect it will be
a simple uart write function that is not thread safe. If you have
access to the registers and interrupt service routines then you can
create a driver that uses FreeRTOS primitives and therefore allows
readers and writers to block - otherwise you will just have to put a
wrapper around the uart functions to prevent context switches while they
are being used - for example wrap in a
vTaskSuspendAll()/xTaskResumeAll() pair. Ideally just have a single
thread that accesses the UART, and if other threads need to access it to
then have those other threads send their messages to the task that is
allowed to access the UART and have that task actually send them out.

ose wrote on Monday, August 20, 2018:

I applied your suggestions and it worked .Thanks