Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2: (5+5+5) Consilet a robotic car with tu thotos, atraction motor for forward/backward motiou and a steering motor for left/right tam To control the
Problem 2: (5+5+5) Consilet a robotic car with tu thotos, atraction motor for forward/backward motiou and a steering motor for left/right tam To control the woment following microcontroller circuit, as shown in Figure 1. my bel. The user comandare recivel las the microcontroller using its UART interface and are executed by clriving the appropriate pins on Port D. detailed below. POO RXD V V00 TXD RTS POSUSTA POAUBRE Traction Motor V,>V, Forward V>V, Reverse PO1 POZ Steering Motor V>V. Left V>V, Right TM4C123 POS Figure 1: Motor connection diagram for Problem 2. (a) Write a UART initialization routine that configuras UARTO (on port pins PD4 and PD6) fur baud-rate 19200, 7 data bits, even purity and 2 stop bit. Assume that the processor and UART module are operating at a system clock frequency of 64 MHz. Different UART registers are described in Tables 2, 4 and 3. Only selected bit fields are descrihed. () Write a function that receives character commands from UARTE, and drives PD(3:0) as follows. 1. Forward - PDO = 1. PDI = 0 2. Backward - PDO = (), PD1 = 1 3. Lali - PD2 = 1, PD3 = 0 1. Riglet PD2 = 0). CD3 = 1 Scanned with CamScanner schon male care nument of rural Engine (c) Suppose that a forward left turn takes 100ms with PDO = 1, PD1 = 0, PD2 = 1, PD3 = 0, use one-shot mode of Timero A to program left turn. Different timer related registers are described in Tables 5, 6 and 7. Only selected bit fickis am described. Table 1: Register labels and brief description. Register label Brief description GPIO.OD.R Open drain selection register, wet 1 for open drain. GPIO.PU.R Pull-up selection register, set 1 for pull-up. GPIO.PD.R Pull-down selection register, wet 1 for pull-down. GPIO.DEN.R Digital enable register, 1 to enable GPIO.DATA.R Data register CPIO.DIR.R Direction register, set 1 for output. Table 2: CART registers for baud rate configuration and their bit field descriptions. USALDJA BONN VATRAC San V INT Buat FRAC Description TART lad rates divisionfiguration mister for intriget part. Once the baud divisor is obtained, its integer fart i ca 16-bit to this hit Held of UART.BAUDINTR register L'ART rate divine cunguration register for fractional purt. This bit field of UART_BAUD.FRACR teister is configur w miltiplying the fractional part of brud.divisor by 64 and adding 0.5 to it, Check ounce configuration bit field is und select the UART clock source. Setting this bit field to selects the system clock VART clock (which is also the default setting), while configuring a value of 5 makes the en internal oscillator in the UART cluck souron CLK SCR Table 3: UART control configuration register and selected bit field descriptions RTE WENN ten OTICA w 13it te Description Rx EN, TX EN UARI TX and fex functions can be individually enabled or disabled using these bit fields. To enable VART "I'x and/or Ix, the bit fields should be set to 1 In addition, UART EN bit should also be set to HS EN High speed enable bit uw to select the UART clock scaling factor. Clearing this bit selects a clock scaling factor of 10, while setting it to 1 mlects a scaling factor of 8 UART EN Setting this bit to enables the UART interface Problem 2: (5+5+5) Consilet a robotic car with tu thotos, atraction motor for forward/backward motiou and a steering motor for left/right tam To control the woment following microcontroller circuit, as shown in Figure 1. my bel. The user comandare recivel las the microcontroller using its UART interface and are executed by clriving the appropriate pins on Port D. detailed below. POO RXD V V00 TXD RTS POSUSTA POAUBRE Traction Motor V,>V, Forward V>V, Reverse PO1 POZ Steering Motor V>V. Left V>V, Right TM4C123 POS Figure 1: Motor connection diagram for Problem 2. (a) Write a UART initialization routine that configuras UARTO (on port pins PD4 and PD6) fur baud-rate 19200, 7 data bits, even purity and 2 stop bit. Assume that the processor and UART module are operating at a system clock frequency of 64 MHz. Different UART registers are described in Tables 2, 4 and 3. Only selected bit fields are descrihed. () Write a function that receives character commands from UARTE, and drives PD(3:0) as follows. 1. Forward - PDO = 1. PDI = 0 2. Backward - PDO = (), PD1 = 1 3. Lali - PD2 = 1, PD3 = 0 1. Riglet PD2 = 0). CD3 = 1 Scanned with CamScanner schon male care nument of rural Engine (c) Suppose that a forward left turn takes 100ms with PDO = 1, PD1 = 0, PD2 = 1, PD3 = 0, use one-shot mode of Timero A to program left turn. Different timer related registers are described in Tables 5, 6 and 7. Only selected bit fickis am described. Table 1: Register labels and brief description. Register label Brief description GPIO.OD.R Open drain selection register, wet 1 for open drain. GPIO.PU.R Pull-up selection register, set 1 for pull-up. GPIO.PD.R Pull-down selection register, wet 1 for pull-down. GPIO.DEN.R Digital enable register, 1 to enable GPIO.DATA.R Data register CPIO.DIR.R Direction register, set 1 for output. Table 2: CART registers for baud rate configuration and their bit field descriptions. USALDJA BONN VATRAC San V INT Buat FRAC Description TART lad rates divisionfiguration mister for intriget part. Once the baud divisor is obtained, its integer fart i ca 16-bit to this hit Held of UART.BAUDINTR register L'ART rate divine cunguration register for fractional purt. This bit field of UART_BAUD.FRACR teister is configur w miltiplying the fractional part of brud.divisor by 64 and adding 0.5 to it, Check ounce configuration bit field is und select the UART clock source. Setting this bit field to selects the system clock VART clock (which is also the default setting), while configuring a value of 5 makes the en internal oscillator in the UART cluck souron CLK SCR Table 3: UART control configuration register and selected bit field descriptions RTE WENN ten OTICA w 13it te Description Rx EN, TX EN UARI TX and fex functions can be individually enabled or disabled using these bit fields. To enable VART "I'x and/or Ix, the bit fields should be set to 1 In addition, UART EN bit should also be set to HS EN High speed enable bit uw to select the UART clock scaling factor. Clearing this bit selects a clock scaling factor of 10, while setting it to 1 mlects a scaling factor of 8 UART EN Setting this bit to enables the UART interface
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started