this is my programm. why is it not working? #include <XC888CLM.h> #include <stdio.h>
Timer 1 Interrupt Service Routine.
void timer1_ISR (void) interrupt 3 { while (TF1==0); TR1=0; P3_DATA=!P3_DATA; // Invertieren von P3 }
//MAIN C function
void main (void) { SFR_PAGE(_pp0, noSST); // Change to page 0 P3_DIR=0XFF; P3_DATA=0Xff;
TMOD = 0x02; /* Set Mode (8-bit timer with reload) */ TH1 = 5; TL1 = 0; ET1 = 1; /* Enable Timer 1 Interrupts */ TR1 = 1; /* Start Timer 1 Running */ EA = 1; /* Global Interrupt Enable */ TF1=0; CMCON = 12;
while (1) { } }
"why is it not working?"
Who knows?!
You haven't even said what you think it is supposed to do - ie, what constitutes "working"
You haven't said what it actually does do. You haven't said why you consider that to be "not working".
What debugging have you done?
Have you run it in the simulator?
sorry I forgot to explain what the programm is supposed to do. i want to use the timer 1 in modus 2 (Autoreload) to synxchronise the on-off process of the leds of port3. after each overflow, the leds should change their state.
when in compile and run, i get 0 warnings, 0 errors, but Port 3 goes one time on and off, and nothing else .
i am using the mcbxc888 eval. board with ulink.
thanks