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 Interrupt problem in a ARM7TDMI Core Processor

Dear Sir,

This is Thillai Elayaraja S from SCOLIS Technologies (India) Pvt. Ltd., Chennai, INDIA. We are into the development of Timer APIs for the Agere's USS2828 Full Speed USB Chip with its ARM7TDMI Core. We are wondering that though we were proper in all the clock configurations (CLKRST Module) and in the Interrupt Configurations (PIC Module) we were not able to get an Interrupt while the Down Counter of the Timer module reaches Zero. Hereby we have attached the codes for your kind reference. Please check it up and guide us where we went wrong. We apologize for the wrong code, if any…

With Anticipation,
Thillai Elayaraja S

//
// C Code
//

// Timer Initialisation module

void TimerHalInit (void)
{

// Enable Clock for Timer Block

CLKRSTGATE &= ~CLKRSTGATE_TIMERCLK_;

// Reset the control bits of Timer1 and Timer2

TIMER1CTL = 0x0;

// Initialize Timer1 to its Load Value

TIMER1BGL = (TIMER_LOAD_VALUE ((WORD) 1)); TIMER1LOAD = (TIMER_LOAD_VALUE ((WORD) 1));

// Start Timer1 in 32 Bit, Prescale0, Interrupt/Timer Enable & in Periodic mode

TIMER1CTL |= (TIMERCTL_32BITTIMER_ | TIMERCTL_PRESCALE0__ | TIMERCTL_INTEN_ | TIMERCTL_PERIODICMODE_ | TIMERCTL_TIMEREN_);

// Enable Timer1 Interrupts in Interrupt Controller Module

PICINTEN |= PICIRQ_TIMER1_;

// Clear the I Bit of the CPSR register

ArmHalEnableInterrupt ();
}

// Timer Interrupt module

__irq void arm_irq_exception (void)
{

// Just Turns on a LED connected to a GPIO for indicating that an Interrupt occured

LedManTurnOn (0x01);
}

// startup.s

; ..
; Stack Initialisations
; ..

AREA Reset, CODE, READONLY, ALIGN=2

B Reset_Handler ; on reset go to code in ROM
B uss2828_soft_reset
B uss2828_soft_reset
B uss2828_soft_reset
B uss2828_soft_reset
NOP ; Reserved vector
IMPORT arm_irq_exception
PRESERVE8

B arm_irq_exception
B uss2828_soft_reset

DCI 0x12345678

IMPORT uss2828_soft_reset

EXPORT Reset_Handler

Reset_Handler

NOP
NOP
NOP
NOP
NOP

; ..
; Stack and Memory Pointer Configurations
; ..

BL __main

EXPORT AsmJmpToFuncFirmware ; Location where the Functional Firmware resides

START_FNCFW EQU 0x20010000
START_FNCFW_EXTMODE EQU 0x00010000
START_FNCFW_CLFPGA EQU 0x00005000

AsmJmpToFuncFirmware

SUB SP, SP, #0x100
MOV PC, R12
END

0