Part Number: TMS320C6748
Other Parts Discussed in Thread: TMS320C6748
Hello,
I am using tms320c6748 lcdk kit. I want to configure GPIO5[8] that comes to J14 pin 27 as external interrupt on rising edge. As given in c6748 technical reference manual page 899 I want to do following:
To configure a GPIO interrupt to occur only on rising edges of the GPIO signal:
• Write a logic 1 to the associated bit in SET_RIS_TRIG.
• Write a logic 1 to the associated bit in CLR_FAL_TRIG.
But in my program when I try to program those registers , they are not programmed. Given below is my program. Please help me find mistake.
#include "gpio.h"
#include "psc.h"
#include "interrupt.h"
#include "soc_C6748.h"
#include "lcdkC6748.h"
#include"hw_types.h"
#include"hw_syscfg0_C6748.h"
/****************************************************************************/
/* LOCAL FUNCTION PROTOTYPES */
/****************************************************************************/
static void Delay(volatile unsigned int delay);
/****************************************************************************/
/* GLOBAL VARIABLES */
/****************************************************************************/
/****************************************************************************/
/* LOCAL FUNCTION DEFINITIONS */
/****************************************************************************/
#define gpio_base_add 0x01e26000
int flag=0;
void GPIOBank5Pin6PinMuxSetup();
static void gpioIsr();
static void SetupInt(void);
static void ConfigureIntgpio(void);
int main(void)
{
/* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
/* Pin Multiplexing of pin 8 of GPIO Bank 5.*/
GPIOBank5Pin6PinMuxSetup();
/* Sets the pin 89 (GP6[13]) as output.*/
GPIODirModeSet(SOC_GPIO_0_REGS, 87, GPIO_DIR_INPUT);
SetupInt();
/* Configure AINTC to receive and handle UART interrupts. */
ConfigureIntgpio();
// HWREG(gpio_base_add+0x74)=0x00400000; //set set_ris_trig45
// HWREG(gpio_base_add+0x80)=0x00400000; //set clr_fal_trig45
HWREG(0x01e26074)=0x00400000; //set set_ris_trig45
HWREG(0x01e26080)=0x00400000; //set clr_fal_trig45
while(1);
}
/*
** \brief This function checks the insertion status of the MMC/SD card
** in the device and prints related statements on the serial
** commuincation console of the external device.
**
*/
/*
** \brief This function can be called to generate a delay.
*/
static void Delay(volatile unsigned int delay)
{
while(delay--);
}
void GPIOBank5Pin6PinMuxSetup()
{
HWREG(0x01c14150) |=0x00000080; //set corresponding bits in pinmux12
HWREG(0x01c14150) &=0xFFFFFF80;
}
static void gpioIsr()
{
flag=1;
HWREG(gpio_base_add+0x74)=0x00000000; //set set_ris_trig45
HWREG(gpio_base_add+0x80)=0x00000000; //set clr_fal_trig45
}
static void SetupInt(void)
{
#ifdef _TMS320C6X
// Initialize the DSP INTC
IntDSPINTCInit();
// Enable DSP interrupts globally
IntGlobalEnable();
#else
/* Initialize the ARM Interrupt Controller(AINTC). */
IntAINTCInit();
/* Enable IRQ in CPSR.*/
IntMasterIRQEnable();
/* Enable the interrupts in GER of AINTC.*/
IntGlobalEnable();
/* Enable the interrupts in HIER of AINTC.*/
IntIRQEnable();
#endif
}
static void ConfigureIntgpio(void)
{
#ifdef _TMS320C6X
IntRegister(C674X_MASK_INT4, gpioIsr);
IntEventMap(C674X_MASK_INT4, SYS_INT_GPIO_B5INT);
IntEnable(C674X_MASK_INT4);
#else
/* Registers the UARTIsr in the Interrupt Vector Table of AINTC. */
IntRegister(SYS_INT_GPIO_B5INT, gpioIsr);
/* Map the channel number 2 of AINTC to UART2 system interrupt. */
IntChannelSet(SYS_INT_GPIO_B5INT, 2);
IntSystemEnable(SYS_INT_GPIO_B5INT);
#endif
}
/*****************************END OF FILE************************************/
Thanks in advance.
With Regards
Shalini