Menu

[Solved]Create Preprocessor Directives Using Pragma Define Following Code Segment Compile Written Q37212681

Create preprocessor directives using #pragma and #define such that the following code segment will compile as written. #incluFor example, the first one would be: #include <msp439 . h> #pragma volatile unsigned char pi_dir; chan because 8-bit data #deCreate preprocessor directives using #pragma and #define such that the following code segment will compile as written. #include <msp430. h> int main(void) NDTCTL WDTPW | WDTHOLD; I/ stop watchdog timer pi_dir &bit3; p1 out – bit3; pi ren I- bit3; pl ie -bit3; // P1.3 direction input // P1.3 output -high // P1.3 pull-up enabled // P1.3 interrupt enabled // P1.3 interrupt flag reset return 8; Hints: Refer to the User Guide Table 8-2: 8.3 Digital VO Registers The digital VO registers are listed in Table 8-2 Table 8-2. Digital VO Registers Register Ty Read only Short Form PIIN PIOUT P1DIR PIFG PIES PIE PISEL PISEL2 PIREN Address Register Initial State Port 021h 022h 0230 output Orecton Interrupt Flag Reset with PUC Reset wth PUC P inemupt Edge Select Reset with PUC Reset with PUC Reset with PUC Reset with PUC 025h Interrupt Enable Port Select Port Select 2 Resis or Enable 04 1h For example, the first one would be For example, the first one would be: #include <msp439 . h> #pragma volatile unsigned char pi_dir; chan because 8-bit data #define bit3 0x88 int main(void) // define Pl Direction register address LOCATİON( pl_dir , exee22 ); WDTCTL WDTPW I WDTHOLD; I/ stop watchdog timer pl_dir &–bit3; // P1.3 direction = Input return ; Show transcribed image text Create preprocessor directives using #pragma and #define such that the following code segment will compile as written. #include int main(void) NDTCTL WDTPW | WDTHOLD; I/ stop watchdog timer pi_dir &bit3; p1 out – bit3; pi ren I- bit3; pl ie -bit3; // P1.3 direction input // P1.3 output -high // P1.3 pull-up enabled // P1.3 interrupt enabled // P1.3 interrupt flag reset return 8; Hints: Refer to the User Guide Table 8-2: 8.3 Digital VO Registers The digital VO registers are listed in Table 8-2 Table 8-2. Digital VO Registers Register Ty Read only Short Form PIIN PIOUT P1DIR PIFG PIES PIE PISEL PISEL2 PIREN Address Register Initial State Port 021h 022h 0230 output Orecton Interrupt Flag Reset with PUC Reset wth PUC P inemupt Edge Select Reset with PUC Reset with PUC Reset with PUC Reset with PUC 025h Interrupt Enable Port Select Port Select 2 Resis or Enable 04 1h For example, the first one would be
For example, the first one would be: #include #pragma volatile unsigned char pi_dir; chan because 8-bit data #define bit3 0x88 int main(void) // define Pl Direction register address LOCATİON( pl_dir , exee22 ); WDTCTL WDTPW I WDTHOLD; I/ stop watchdog timer pl_dir &–bit3; // P1.3 direction = Input return ;

Expert Answer


Answer to Create preprocessor directives using #pragma and #define such that the following code segment will compile as written. #… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *