Kang Liang Thng

Getting started with 13213 SRB

Discussion created by Kang Liang Thng on Sep 24, 2006
Latest reply on Sep 26, 2006 by Kang Liang Thng
Hi,
i have created a simple program using the software codes provided below. When i press "debug" in the CodeWarrior IDE, it runs well, but the led2 does not light up when SW2 is pressed on the SRB. Did i miss any important steps in the process of downloading the program to the MCU?



#include /* for EnableInterrupts macro */
#include /* include peripheral declarations */
#include "M68DEMO908GB60.h"

void main(void) {
EnableInterrupts; /* enable interrupts */
/* include your code here */

PTADD = 0; //initialize as input (Data Direction Rregister)
PTAPE = 0xf0; //Pullups on upper 4 bits

/*initialize bits 0-3 of Port F as outputs (connected to led's)*/
PTFDD = 0x0f;
LED1 = OFF;
LED2 = OFF;
LED3 = OFF;
LED4 = OFF;
LED5 = OFF;

for(;:smileywink: {
__RESET_WATCHDOG(); /* kicks the dog */
LED2 = SW2;
} /* loop forever */
}

Outcomes