Newbie Questions

By pmelo , 31 March 2014

I'm trying to develop a remote sensing application combining the MPU9150 with Anaren's CC2530. I've successfully compiled and run both the compdcm_mpu9150 and Simple Application - End Device examples. I've placed the Sensor Hub atop the CC2530 which itself sits upon the Tiva C. I assume this is allowed? I've started moving the sensor interrupt code from the compdcm_mpu9150 example to the end device example. Since the end device example uses GPIO ports A-F, I've changed the MPU9150 port to G. I have added the following code immediately after all the other port initializations, but all three of the GPIO calls causes an immediate hard fault :

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
PERIPHERAL_ENABLE_DELAY();
GPIOPinTypeGPIOInput(GPIO_PORTG_BASE, GPIO_PIN_2);
GPIOIntEnable(GPIO_PORTG_BASE, GPIO_PIN_2);
GPIOIntTypeSet(GPIO_PORTG_BASE, GPIO_PIN_2, GPIO_FALLING_EDGE);

IntEnable(INT_GPIOG);

I've also added the interrupt handler to my startup :

IntDefaultHandler, // Analog Comparator 2
IntDefaultHandler, // System Control (PLL, OSC, BO)
IntDefaultHandler, // FLASH Control
IntGPIOf, // GPIO Port F
IntGPIOg, // GPIO Port G
IntDefaultHandler, // GPIO Port H
IntDefaultHandler, // UART2 Rx and Tx
IntDefaultHandler, // SSI1 Rx and Tx

void IntGPIOg(void)
{
unsigned long ulStatus;

ulStatus = GPIOIntStatus(GPIO_PORTG_BASE, true);

GPIOIntClear(GPIO_PORTG_BASE, ulStatus);
}
}

Any idea what might be happening here? Is there something special about G that needs to be dealt with? I haven't included driverlib or sensorlib in my CCS project yet, are they necessary at this point? The compdcm_mpu9150 example also uses GPIO ports A and D. Are these portions necessary to get G to work?

phpbb Topic ID
16047