Question

If you were to use UART5 at pins PE4 and PE5, how would you program the...

If you were to use UART5 at pins PE4 and PE5, how would you program the GPIO registers?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Following steps may be used

1) initially give a clock to UART5 by setting 1 to bit 5 in UART Run-Mode Clock Gating Control register
2) Activate Port E, as U5Rx and U5Tx are corresponding to PE4 and PE5
3) Disable UART5 by clearing bit 0 in UART5_CTL_R during initialization
4) Write the inter portion of the baud rate to UART5_IBRD_R
5) Write the fractional portion of the baud rate to UART5_FBRD_R
6) Configure the line control value for 1 stop bit, FIFO enable and 8-bit data size. So we need write 0x70 to UART5_LCRH_R
7) Set TXE and RXE bits in UART5_CTRL_R to enable the transmitter and receiver of UART5
8) Enable UART5 by setting bit 0 in UART5_CTL_R
9) Disable analog functions for PE5 and PE4
10) Enable alternate functions for PE5 and PE4
11) Configure PE5 and PE4 pins for UART function
12) Make PE5 and PE4 pins to be used as digital I/O
As you can see, the last four steps should be familiar. They are also needed for GPIO initialization.

Add a comment
Know the answer?
Add Answer to:
If you were to use UART5 at pins PE4 and PE5, how would you program the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT