This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TUSB3410 Timer

Hello,

I'm using TUSB3410 for development of USB to serial interface. For testing purpose I've written one small program for timer intrerupt using SDCC and Eclispe. The control is not going to interrupt routine. Can anyone help?

/*
* main.c
*
* Created on: Jun 27, 2016
* Author: user3
*/

#include <8052.h>


#define ToggleGpio(x) P3_##x ^= 1


extern void delay (void);
void ConfigTimer__0(void);
void timer1_ISR (void) __interrupt (3);


void main(void)
{
P3_1 = 0;
ConfigTimer__0();
while(1){
P3_0 ^= 1;
delay();

}

}

void ConfigTimer__0(void)
{
//--------------------------------------
// Set Timer0 for 8-bit auto reload timer mode. The
// timer counts to 65535, overflows, and
//generates an interrupt.
//Set the Timer0 Run control bit.
//--------------------------------------
P3_3 = 0;
TH1 = 0x7F;
TL1 = 0x7F;
TMOD = (TMOD & 0xF0) | 0x20; // Set T/C1 Mode2
ET1 = 1; // Enable Timer 1 Interrupts
TR1 = 1; // Start Timer 1 Running
EA = 1; // Global Interrupt Enab
}

void timer1_ISR(void) __interrupt (3)
{
P3_4 ^= 1;
P3_3 ^= 1;
}