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

MODIFY CODE. READ ALL INSTRUCTIONS. USING MSP430G2553 MODEL MICROPROCESSOR Modif

ID: 3785656 • Letter: M

Question

MODIFY CODE. READ ALL INSTRUCTIONS. USING MSP430G2553 MODEL MICROPROCESSOR

Modify your design of assignment #1 by feeding back the FA outputs into the MSP430. Modify your software to compare the actual FA outputs with the expected outputs. If actual and expected outputs differ, the program should stop to show the bad I/O combination and turn on an error indicator. The program should resume following the FA truth table once the difference in outputs disappears.

#include sp430, h int main(void) WDTCTL. WDTPW WDTHOLD Stop watchdog timer P1DIR I- 0x07 Set P1.0 to output direction for volatile unsigned int i P10UT i; Toggle P1.0 using exclusive-OR for K50000 eturn

Explanation / Answer

//Description of code for MSP430G2553 MODEL MICROPROCESSOR

#include <msp430.h>

int main(void)

{

}

Disable watchdog timer:

WDTCTL=WDTPW+WDTHOLD;

The watchdog timer is a safety mechanism which will carry out a controlled

System restart should a software problem arise,It will reset the system if a

Specified time interval elapses.

Specify pin directions i.e inputs vs outputs(P1DIR/P2DIR)

Inputs=0

Outputs=1

Each bit or pin must be specified.The default is 0 i.e input.

Outputs(P1OUT/P2OUT)

It is not possible to just write one single bit/pin.Thus you must specify the

Full byte e.g. to turn on P1.2 and leave all other pins of port 1 low,you would

Type

P1OUT=0b00000100;

Delay intervals

_delay_cycles(X)

Where X is the number of cycles to pause for.

For the MSP430G4252 this equates to approximately X microseconds.

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