Question: J - Link Lab 2 and 3 C Program Review Lab 2 and 3 to finish the following questions about using w 4 and

J-Link Lab 2 and 3
C Program
Review Lab 2 and 3 to finish the following questions about using "w4 and mem32" commands:
Which register is used to configure port 0 as an input port? What is the address of this register? Register: and its address is
Which register is used to read port 0 data into microprocessor? What is the address of this register? Register and its address is
Which register is used to configure port 6 as an output port? What is the address of this register? Register: and its address is
Use J-Link "w4" command to configure port 0 as an input port:
Use J-Link "w4" command to configure port 6 as an output port:
Use J-Link "mem32" command to read data from port 0 into microprocessor:
Use bitwise operation to get bit 6 of port 0 in order to see whether 54 are pressed or not.
If bit 6 is 0,S4 is pressed ( P 12 in SK-S7G2 schematic) and turn on the green LED connected to P600, e.g. reset P600, PODR00=0.. If 54 is releases, turn off green LED.
Use J-Link "4" command to turn on the green LED connected to P600.
Use J-Link "w4" command to turn off the green LED connected to P600
If (POdata ==0)
/*=P0CTR1=0x00000000;
P6CTR1=0x0000FFFF;
??*=to read in data from port*
Unsigned long P0data =P0CTR2;
??* Using logic calculation to get bit 6 value*
P0data =P0data ??& 0x00000060; ??*if bit 6=0,54is pressed, and
POdata =0*?*
= write data to LED*P6CTR1=0x0007FFFF;
J - Link Lab 2 and 3 C Program Review Lab 2 and 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!