Alberto,
as far as I can see this looks OK. You never set up the prescaler
divider for the timer but I don't remember the default for it so that
may be OK. Have you checked that the timer is actually running?
/Ake.
ualbe wrote:
> Dear Ake,
> I tested your VIC sequence but it still doesn't work.
> I'm reading my code but It seem correct.
> Here it is an example
> thanks
>
> Alberto
>
> static init(void)
> {
> // Init Vector Interrupt Controller
> VICIntEnClr = 0xFFFFFFFFL; // Disable all Ints
> VICIntSelect = 0x00000000L;
>
> // Install Default IRQVec
> VICDefVectAddr = (unsigned long) DefaultISR; // set interrupt
> vector
>
> // Initialisation of CAN interfaces
> // CAN interface 1, use IRQVec0, at 125kbit
> CANAll_Init(1,0,CANBitrate125k_60MHz);
>
> // CAN interface 2, use IRQVec1, at 125kbit
> CANAll_Init(2,1,CANBitrate125k_60MHz);
>
> // Set CAN Err ISR to IRQVec2
> CANAll_SetErrIRQ(2);
>
> // Initialize Timer Interrupt
> T0MR0 = 5999; // 100 microseconds = 6.000-1 counts
> T0MCR = 3; // Interrupt and Reset on MR0
> T0TCR = 1; // Timer0 Enable
>
> // Set Timer0 ISR to IRQVec3
> VICVectAddr3 = (unsigned long) Timer0ISR; // set interrupt vector
> VICVectCntl3 = 0x20 | 4; // use it for Timer 0 Interrupt
> VICIntEnable = 0x00000010; // enable Timer0 Interrupt
>
> }
>
> void Timer0ISR (void)
> {
> gTimerTick++;
> T0IR = 1; // Clear interrupt flag
> VICVectAddr = 0xFFFFFFFF; // Acknowledge Interrupt
> }
>
>
>
>
>
>
> SPONSORED LINKS
> Microprocessor
> <http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g>
> Microcontrollers
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg>
> Pic microcontrollers
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ>
>
> 8051 microprocessor
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> * Visit your group "lpc2000
> <http://groups.yahoo.com/group/lpc2000>" on the web.
>
> * To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>
--
---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se
Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org
[Non-text portions of this message have been removed]