Hi
You don't mention which board you're using, so your mileage may vary...
On the Freescale M5329EVB evaluation board, I believe there's an LED wired to the TIMER3 pin in the TIMER port.
You need to do two things:
(a) Configure the TIMER port so that the pin is a General-Purpose Output (It could also be an input, or be used for non-I/O purposes like a UART 2 receive pin)
/* Pin assignments for port TIMER
Pins are all GPIO outputs
*/
MCF_GPIO_PDDR_TIMER =
MCF_GPIO_PDDR_TIMER_PDDR_TIMER3 |
MCF_GPIO_PDDR_TIMER_PDDR_TIMER2 |
MCF_GPIO_PDDR_TIMER_PDDR_TIMER1 |
MCF_GPIO_PDDR_TIMER_PDDR_TIMER0;
MCF_GPIO_PAR_TIMER = 0;
(b) Change the state of the pin to turn the LED on or off. The following loop would flash it:
/* Sample code: Loop to flash LED */
while (1) {
MCF_GPIO_PODR_TIMER ^= MCF_GPIO_PODR_TIMER_PODR_TIMER3;
for (i = 0; i < 500000; i++)
asm ( "nop" );
}
(The "nop" instruction just prevents the compiler from optimising out the delay loop between flashes)
Hope this helps
Simon