need help in writing UART drivers

Thread Starter

Amit Dhiman 1

Joined Oct 14, 2017
6
Hi,

consider me noob here , i have started learning embedded with tiva c series launchpad ,and now i need to learn how to write drivers for UART. now i am totally confused , where to start and how to start .

if someone please help me from start writing.

sorry for asking this much.
 

jpanhalt

Joined Jan 18, 2008
11,087
The golden rule is to use a circular buffer on Rx side.
Yes, that can help. But there are so many unknowns at this point of the discussion, I would be wary of saying that was a rule. Untold numbers of LCD displays receive USART data without FIFO/ring buffers.

Some questions that affect that decision:
1) What baud rate are you sending the data?
2) What is your MPU instruction rate (i.e., Tcy)?
3) What do you need to do with the data once received? For example, simply converting to decimal ascii and sending to a display can be done very quickly and well within the time for a character at 9600 baud.
4) Can you use a ready to send/receive bit/pin? For example, a fast ADC running continuously could overwhelm even a large ring buffer and slow MCU.
5) Will the USART be hardware or software?

Since you self-describe as a noob, I think it would be best to get the USART up and running, then deal with a ring buffer if needed.
 
Top