FreeRTOS and USART with ATmega32
Posted by Mike M on November 28, 2011
I am using an ATmega32. I have a serial lcd that works great outside of freeRTOS, but when I re-configure the code and place it into freeRTOS, it does not work. After some research online I think I discovered that I needed to add freeRTOS_serial.c and freeRTOS_serial.h in order to use the USART capabilities of my atmega32. My problem is that after adding these files, it still will not work. I cant find any info online about using USART with freeRTOS. I just dont understand if I have to change anything in the freeRTOS_serial.c file or not? Can anyone de-mystify using USART within freeRTOS for me?
I know that adding the files is needed because after running the program with the added files, lots of ascii gibberish was seen rushing across the screen, where before there was nothing. Could it be a baud rate issue?
RE: FreeRTOS and USART with ATmega32
Posted by Richard
on November 29, 2011
I don't know what FreeRTOS_serial.c and FreeRTOS_serial.h came from. There are no files in the FreeRTOS demo called that. There are demo serial port files in FreeRTOS, but they are not designed to be efficient, just test the port by using queues in an interrupt and generating as high an interrupt load as possible.
As long as you write your interrupt service routines in compliance with the instructions given on the documentation page for the port you are using, there is very little mutual reliance on FreeRTOS and how you write you UART drivers. FreeRTOS provides a means for the ISR to communicate and synchronize with tasks, and a means for context switches to happen in ISRs (if an ISR causes a task to unblock, and the task has a priority higher than the currently running task) - and (currently) not much else.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.