Other Parts Discussed in Thread: TMS320F2812
Due to I´ve already spend a whole day with this little problem, I think it´s the best to ask you for some help...
It´s my first time with the C2000 DSPs but I´ve already worked with the MSP. I am using the EZdsp board with a TI TMS320F2812
I actually try to program a simple Code with a external Interrupt to toggle an LED.
So if i turn on 2,5V on the XINT1 Port, the LED on the PWM1 Port should toggle.
Instead I can´t get into the ISR. If I turn on the Voltage, nothing happens.
Maybe someone can help me? I´ve already found the DSP281x_examples_ccsv4 but it wasn´t helpful to solve my problem or just didn´t understand it how to use.
Thank you very much in advance!
Benjamin
------------------------------------------------------------------------------------------------------------------------------
// Prototype statements for functions found within this file.
interrupt void XINT1_ISR(void);
// Global data variables used for this exam
void Gpio_select(void);
void main(void)
{
// Step 1. Initialize System Control:
InitSysCtrl();
// For this example use the following configuration:
Gpio_select();
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
// Initialize PIE control registers to their default state.
InitPieCtrl();
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
InitPieVectTable();
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
EALLOW; // Allow access to EALLOW protected registers
PieVectTable.XINT1 = &XINT1_ISR; // For signal
XIntruptRegs.XINT1CR.all = 0x0005; //Polarity low-to-high// Enable Interrupt
EDIS; // Disable access to EALLOW protected registers
// Enable interrupts required
EnableInterrupts();
// Wait for all Group 1 interrupts to be serviced
while(PieCtrlRegs.PIEIFR1.all != 0x0000 ){}
// Step 6. IDLE loop. Just sit and loop forever (optional):
for(;;);
}
//------------------------------------------------------------------------------------------------
interrupt void xint1_isr(void)
{
Uint16 i;
// Set interrupt priority:
PieCtrlRegs.PIEIER1.all = M_INT4;
IER |= M_INT2; // Set "global" priority
// Enable global Interrupts and higher priority real-time debug
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
for (i = 0; i < 4000; i++) {}
GpioDataRegs.GPASET.all =0xFFFF; //^=
asm(" NOP");
// Acknowledge interrupt to receive more interrupts from PIE group 2
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
void Gpio_select(void)
{
Uint16 var1= 0x0000; // sets the Input qualifier values
EALLOW;
GpioMuxRegs.GPAMUX.all=0x0000;
GpioMuxRegs.GPEMUX.all=0x0000;
GpioMuxRegs.GPADIR.all=0xFFFF; // GPIO PORTs as output
GpioMuxRegs.GPEDIR.all=0x0000; // GPIO DIR select GPIOs as output
GpioMuxRegs.GPAQUAL.all=var1; // Set GPIO input qualifier values
GpioMuxRegs.GPEQUAL.all=0xFFFF;
EDIS;
}