Hi guys
I'm using HET interrupt to toggle HET0..7 LEDs und my code is based on the example code from TI. However, it seems there is no interrupt happened. Can anyone tell me what might be the problem? Thanks in advance.
Here is my code:
__no_init volatile HETPROGRAM0_UN e_HETPROGRAM0_UN @ 0x800000;
HET_MEMORY const HET_INIT0_PST[1] =
{
/* L00_0 */
{
0x00000601,
0x00002000,
0x00000000,
0x00000000
}
};
void main(void)
{
__disable_interrupt();
PCR = CLKDIV_2; // ICLK = SYSCLK / 2
GCR = ZPLL_CLK_DIV_PRE_1; // SYSCLK = 8 x fOSC
PCR |= PENABLE; // Enable peripherals
REQMASK = (1 << CIM_HET1); // Enable HET Interrupt mask
HETGCR = CLK_MASTER + IGNORE_SUSPEND; // HET Master Mode, Ignore SW BP
// Copy HET instructions to HET RAM
MemCopy32((void *) &e_HETPROGRAM0_UN, (void *) HET_INIT0_PST, sizeof(HET_INIT0_PST));
HETPRY = 0x01; // Int on instruction 1 is
high-priority
HETPFR = 0x0000052b; // Set PFR register
HETDCLR = 0xffffffff; // Clear HET output latches
HETDIR = 0xffffffff; // Set HET as GIO outputs
HETGCR |= ON; // Start HET
__enable_interrupt(); // Enable Interrupts
while (1); // Loop forever...
}
//------------------------------------------------------------------------------
// This module programms the HET RAM with the HET code
//------------------------------------------------------------------------------
void MemCopy32(unsigned long *dst, unsigned long *src, int bytes)
{
for (int i = 0; i < (bytes + 3) / 4; i++)
*dst++ = *src++;
}
//------------------------------------------------------------------------------
// TMS470R1B1M Standard Interrupt Handler
//------------------------------------------------------------------------------
__irq __arm void irq_handler(void)
{
switch((0xff & IRQIVEC)-1)
{
case CIM_HET1 : HET1_irq_handler(); break;
}
}
//------------------------------------------------------------------------------
// HET Instruction 0 Interrupt Handler
//------------------------------------------------------------------------------
void HET_CNT_INT()
{
HETDOUT ^= 0xff; // Toggle HET0..7 LEDs
}
//------------------------------------------------------------------------------
// HET Interrupt Handler
//------------------------------------------------------------------------------
void HET1_irq_handler()
{
switch ((0xff & HETOFF1)-1)
{
case 0 : // Instruction 0
HET_CNT_INT();
break;
}
}
Actually, now i just copy the example code to check the problem, however the result is the same. Another thing is i can not insert breakpoint inside the interrupt functions. Does anyone know why?
Rui