This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timer (Zeitgeber) for Port inverting (blink) XC888/886

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) { }
}

0