Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Rewrite the ritual in Program 7.2 assuming the 9S12C32 PLL is active at 24MHz. I

ID: 3776529 • Letter: R

Question

Rewrite the ritual in Program 7.2 assuming the 9S12C32 PLL is active at 24MHz. In particular adjust the SCIBD register so the baud rate is 9600 bits/sec.

void Printer Init (void) Printer Init empty FIFOs TxFifo Init Jsr TxFi fo Init empty 9600 bits/sec movw 26. SCIBD SCI BD 26 9600 bits/sec movb 0. SCICR 1 M 0, no parity SCICR 1 M 0, no parity SCICR2 0x0C: movb SOC SCICR2 disarm TDRE enable disarm TDRE bc1r TIOS $08 PT3 input capture PT3 input capture bc1r DDRT. $08 PT3 is input DDRT & 0x08 PT3 is input movb #$80 .TSC R1 enable TCNT TSCRI 0x80 enable TCNT TCTL4 0xCO: both rise and fall bset TCTL4.#$CO both rise fall bset TIE. $08. Arm IC3 TIE 0x08 Arm IC3 movb $08, TFLG1 TFLG1 0x08 initially clear initially clear enable interrupts Cli enable asm cli rts void check IC3 (void) check IC3 f (PTT&0x08) brc l r PTT, #$08,not :0 if ready PT3-1 if DTR 12 movb $0C, SCICR2 busy, disarm SCICR2 Oxoc busy, so disarm bra done else not movb $8C.SCICR2 ready, arm SCICR2 0x8C: not busy, so arm done rts Printer OutChar A character Output ASCI I character to Printer spin if TxFifo is full psha void Printer Out Chan (char data) loop ldaa 0,s A character while (TxFIfo Put (data) sr TxF i fo Put save in FIFO check IC3 tbeq A loop check IC3 bsr TDRE set on empty transmit register pula Interrupt 20 void SCIhandler (void) rts SCI handler Char data if ((SCICR2&0x80)&& (SCISR1&TDRE;)) daa SC ISRI f (TxF i fo Get (&data;)) broken if no TDRE bp l fini l daa SCICR2 bit 7 is TIE SCI DRL clears TDRE data disarmed? bp l fini leas 1.s el set X- place SCI CR2 0x2c disarm TDRE. tsx bsr TxF i fo Get pulb tbeq A none stab SCIDRL IC3 interrupt on any change of DTR start output (vold) void interrupt 11 IC3Han bra fini none movb f $2C, SCICR2 disarm TDRE TFLGI 0x08: Ack clear C3F check IC3 Arm SCI if DTR-t 12 fini rti IC3Han movb $08 .TFLGI Ack bsr check IC3 Arm if ready rt i org $FFD6 fdb SCI hand ler org $FFE8 fdb IC3Han Program 7.2 Software implementation of a printer interface with DTR synchronization

Explanation / Answer

It will call GGreater7 if G is greater than 7, GGreaterEq7 if G is greater than or equal to 7, GLess7 if G is less than 7, and GLessEq7 if G is less than or equal to 7. When comparing unsigned values, the instructions BHI BLO BHS and BLS should follow the subtraction or comparison instruction. A conditional if-then is implemented by bringing the first number in a register, subtracting the second number, then using the branch instruction with complementary logic to skip over the body of the if-then. To convert these examples to 16 bits, use the LDRH R0,[R2] instruction instead of the LDR R0,[R2] instruction. To convert these examples to 8 bits, use the LDRB R0,[R2] instruction instead of the LDR R0,[R2] instruction

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote