Tool/software: Code Composer Studio
In my project i want to change status of some pins, I have used PORT K firstly i can out my data to the pin number 0 of the PORT K, but when i am using other pins of the PORT K (eg: pin 1, pin 2,...) ther is no output at the pin. I have used the same steps which used for pin number 0 of PORT K to configure other pins of the PORT K
My code is shown below please help me to find the trouble
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "drivers/pinout.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
uint32_t g_ui32SysClock;
void delay_2ms(uint32_t );
void supplyswitch(bool );
void adc3v3supply(bool );
void second3v3(bool stage);
#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
}
#endif
void
ConfigureUART(void)
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
//
// Enable UART0
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
//
// Configure GPIO Pins for UART mode.
//
ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
//
// Initialize the UART for console I/O.
//
UARTStdioConfig(0, 115200, g_ui32SysClock);
}
//*****************************************************************************
//
// Print "Hello World!" to the UART on the Intelligent UART Module.
//
//*****************************************************************************
void ConfigGPIO(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
delay_2ms(100);
GPIOPinConfigure()
GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, GPIO_PIN_0|GPIO_PIN_1);
GPIOPinTypeGPIOOutput(GPIO_PORTK_BASE, GPIO_PIN_0);
delay_2ms(100);
}
int
main(void)
{
//
// Run from the PLL at 120 MHz.
//
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
//
// Configure the device pins.
//
PinoutSet(false, false);
//
// Enable the GPIO pins for the LED D1 (PN1).
//
ConfigGPIO();
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_1);
//
// Initialize the UART.
//
ConfigureUART();
while(1)
{
//
// Turn on D1.
//
//ROM_GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0,true);
supplyswitch(1);
adc3v3supply(true);
second3v3(true);
LEDWrite(CLP_D1, 1);
UARTprintf("M0 High\r\n");
//
// Delay for a bit.
//
delay_2ms(1000);
//
// Turn off D1.
//
//ROM_GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0,false);
supplyswitch(0);
adc3v3supply(false);
second3v3(false);
LEDWrite(CLP_D1, 0);
UARTprintf("M0 Low\r\n");
//
// Delay for a bit.
//
delay_2ms(1000);
}
}
void delay_2ms(uint32_t delay)
{
// delay=delay/2;
SysCtlDelay(delay*40000);
return;
}
void supplyswitch(bool stage)
{
if(stage==true)
GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0,true);
if(stage==false)
GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0,false);
}
void adc3v3supply(bool stage)
{
if(stage==true)
GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_0,true);
if(stage==false)
GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_0,false);
}
void second3v3(bool stage)
{
if(stage==true)
GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_1,true);
if(stage==false)
GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_1,false);
}
After loading the program to the board i can find the output signal from the pin 0 of PORT H, but there is no output from the pin 1 of PORT H. The same is happening for all the other ports.