Hi,
I am trying to configure the GPIO to provide inputs to the ADC. My GPIO initialisation code is below. My initialisation works for some pins but, for example, GPIO port D PIN 0 ends up with a voltage on it after initialisation.
I have no idea why this should be happening. The code looks fine to me.
Anyone any ideas?
I'm using CCS 5.
Thanks,
Crawford
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/rom.h"
#include "driverlib/pin_map.h"
void GPIOinit2(void)
{
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOD);//enable GPIO-D peripheral
ROM_GPIOPinTypeADC (GPIO_PORTD_BASE, GPIO_PIN_0 |GPIO_PIN_1 |GPIO_PIN_2 | GPIO_PIN_3);
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOE);//enable GPIO-E peripheral
ROM_GPIOPinTypeADC (GPIO_PORTE_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5);
ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOF);//enable GPIO-F peripheral
ROM_GPIOPinTypeGPIOOutput (GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4);
// --------------------Configure PB6 as T0CCP0 for PWM---------------------
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
ROM_GPIOPinConfigure(GPIO_PB6_T0CCP0);
ROM_GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_6);
}