Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Background: This is usually the first step in getting a new embedded system off the ground because it lets the system be controlled and tested

image text in transcribed
Background: This is usually the first step in getting a new embedded system off the ground" because it lets the system be controlled and tested via the serial port with a minimum of software effort. Because the I/O is polled, it is not even necessary to get interrupts working. Required Equipment: MCF52233 DEMO Procedure: Part One: UART Init and send string" 1. Assign the pins to the UART (and not general-purpose I/O) by writing Ox55 to PUAPAR. 2. Write Ox 17 or 0x 13 to UMR 10 and write 0x07 to UMR20. This sets up the UART for 8 data bits, no parity, and I stop bit. 3. Write 0 to UBG10 and 62 (62 decimal) to UBG20. These are the divisors needed for a 19200 baud rate. 4. Write Ox05 to UCRO to enable both the transmitter and receiver. You should now be ready to transmit and receive. 5. Transmit a single character by writing it to UTBO. At this point you should be able to see the character in Hyperterm for debugging purposes (see below for Hyperterm settings). 6. To send a complete string, you need to poll bit 2 of USRO to see when the UART is ready for the next character. (For example, you can read USRO into a variable and AND it with Ox04. The result is 0 if the UART is not ready for another character and non-zero if it is ready.) 7. To send a string, you need to do this. Send one character to "jump-start" the process. Check to make sure the next character in the string is not NULL. If it is NULL you are finished. If it is not NULL, poll USRO until the status bit is non-zero. Write the next character to UTBO. Increment to the next character and iterate. 8. You can observe by connecting the serial port to the PC. As you will notice, it needs to be set on 19200- 8-no parity-1-None in Hyperterm. 9. Demonstrate this to the instructor. Part Two: "receive string" 1. To receive a character, you need to do this: poll USRO and check bit 0 (least significant bit). Do this by ANDing USRO with Ox01. When the result is non-zero, there is a character ready to be received. Background: This is usually the first step in getting a new embedded system off the ground" because it lets the system be controlled and tested via the serial port with a minimum of software effort. Because the I/O is polled, it is not even necessary to get interrupts working. Required Equipment: MCF52233 DEMO Procedure: Part One: UART Init and send string" 1. Assign the pins to the UART (and not general-purpose I/O) by writing Ox55 to PUAPAR. 2. Write Ox 17 or 0x 13 to UMR 10 and write 0x07 to UMR20. This sets up the UART for 8 data bits, no parity, and I stop bit. 3. Write 0 to UBG10 and 62 (62 decimal) to UBG20. These are the divisors needed for a 19200 baud rate. 4. Write Ox05 to UCRO to enable both the transmitter and receiver. You should now be ready to transmit and receive. 5. Transmit a single character by writing it to UTBO. At this point you should be able to see the character in Hyperterm for debugging purposes (see below for Hyperterm settings). 6. To send a complete string, you need to poll bit 2 of USRO to see when the UART is ready for the next character. (For example, you can read USRO into a variable and AND it with Ox04. The result is 0 if the UART is not ready for another character and non-zero if it is ready.) 7. To send a string, you need to do this. Send one character to "jump-start" the process. Check to make sure the next character in the string is not NULL. If it is NULL you are finished. If it is not NULL, poll USRO until the status bit is non-zero. Write the next character to UTBO. Increment to the next character and iterate. 8. You can observe by connecting the serial port to the PC. As you will notice, it needs to be set on 19200- 8-no parity-1-None in Hyperterm. 9. Demonstrate this to the instructor. Part Two: "receive string" 1. To receive a character, you need to do this: poll USRO and check bit 0 (least significant bit). Do this by ANDing USRO with Ox01. When the result is non-zero, there is a character ready to be received

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

denigration of emotional outbursts; being reserved;

Answered: 1 week ago