
XK-1A Development Board Tutorial 7/20
10.
On your XK-1A, verify that LED0 is flashing on-off, and then click the
Terminate
button () to stop your application running.
3.5 Switch between projects
The
Run
button ( ) can be used to switch between projects. To complete this
part of the tutorial, follow these steps:
1.
Click the arrow to the right of the
Run
button and select the Run Configuration
named illuminate.
2. On your XK-1A, verify that all four LEDs are illuminated.
3.
Click the arrow to the right of the
Run
button and select the Run Configuration
named flash.
4. On your XK-1A, verify that LED0 is flashing on-off.
5.
Modify the source of the flashing LED application to change the value of
FLASH_PERIOD from 20000000 to 40000000.
6. To build and run, just click the Run button.
The XDE launches the Run Configuration you most recently selected.
7.
On your XK-1A, verify that LED0 is flashing on-off at half the rate it was flashing
previously, and then click the
Terminate
button () to stop your application
running.
3.6 Exercise
To complete this part of the tutorial, perform the following steps:
1.
Modify your flashing LED application so that both LED0 and LED1 are flashed,
with LED0 flashed twice as fast as LED1.
Show a tip..
You should output the following pattern to the port
led
: 0b0011, 0b0010,
0b0011, 0b0010, 0b0001, 0b0000, 0b0001 and 0b0000.
Explain the solution in more detail..
You can define an array of integers an initialize it with the values 0b0011,
0b0010, 0b0011, 0b0010, 0b0001, 0b0000, 0b0001 and 0b0000. Then use a
loop to output this sequence of values to the port 4F.
Show a sample answer..
# i nc lude < xs1 .h >
# defi ne FL ASH_ PERIO D 20 000000
out port led = XS1_ POR T_4 F ;
X7366A