Datasheet
Maxim Integrated
│
11
www.maximintegrated.com
MAXQ610 Evaluation Kit
Evaluates: MAXQ610
The gpio example uses a timer on the MAXQ610 to blink
four LEDs. The first four pins of Port 3 are wired to these
LEDs, and can be manipulated by the software. By shift-
ing the mask variable, the position of the high bit moves
through the mask to the bit for each LED (Figure 6). The
PD3 register controls the direction of the pins on Port 3.
Setting these bits to one configures them for output and
allows the voltage to be driven low to turn on the LED.
A timer in the MAXQ610 is then used to control the blink
rate of the LEDs. The timer is initialized to count at a con-
stant rate (Sysclk/256) from 0 up to 0xB71B. The default
Sysclk is 12MHz, making the timer raise its flag every
second (Figure 9).
In the blinkLED() function, the mask is used to toggle one
of the LEDs count number of times. Setting the bits of the
P03 register to zero turns on the LED. Raising the bits to
one turns off the LED (Figure 10).
IAR allows the user to view variable and register values
while debugging. To watch a register or variable, right-
click on the expression and select Add to Watch. When
execution has been halted by breakpoint or pressing
the Break button, these values are updated and can be
changed by the user (Figure 11). Registers can also be
viewed by selecting the View menu and clicking Register.
Figure 9. Timer Initialization