ECE471/571 (RTOS) Assignment 8

Program (40pts.)

Develop a product that would encode ASCII text received from a UART serial port into Morse code.

Suggested Program Flow

One task shall read data from the communication port; transcode it into dots, dashes, and silence; and send it to the Morse generator task using an internal queue.

Queues: The sizes of communication queues that are provided in the template program must be changed. The size of the UART queue is sufficient to cache sufficient number of incoming characters until the user is able to respond to the warning RED LED. Estimated reasonable user response time is, say two seconds. Assume that during one second the user can type up to 10 characters. The size of the queue is sufficient to buffer instruction for at least two characters to be sent out.

Typing speed LEDs are controlled inside the first task loop. In case an immediate sending information to the Morse generator task is not possible the warning is activated (RED LED and '\a') and data is send again using blocking forever. When data is sent using the latter method the warning (RED LED) is deactivated. Data is read from UART queue with allowed 0 delay. When there is no data in incoming UART that read fails and the GREEN LED is activated.  Data read is attempted again in the loop with blocking read until successful read. At that time the GREEN LED is switched off and the character is processed.

The Morse generator task implemented in the form of another task, a timer hook, or functionality in the interrupt reads data from the internal queue one instruction at the time. If the functionality is implemented using a task, then simple taskDelay is used to keep the transmission peace. If the functionality is implemented using a timer hook or an interrupt then the transmission peace is kept by counting the number of times the interrupt or timer hook is run before another action is read from the queue. When the queue is empty, the Morse channel is kept inactive (logic low, or LED off).

See the examples relating to C structures for the direct hint how to convert an ASCII character to a series of  dots, dashes, and silences.

Self-Check List

The provided checklist shall assist you in verifying whether your program works correctly be checking for the most ovious problems.

Homework Submission

After testing your program on the board, compress all files from your project folder (including any temporary files created by the compiler). Use ZIP file format (WinZIP or 7Zip). Submit on-line via Canvas.

Thank you.

web site front local main page local list page general bookmarks software bookmarks go back copyright info