Problem with Chip_GPIO_SetPinState

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with Chip_GPIO_SetPinState

652 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by strawhats10 on Fri Jul 31 08:52:48 MST 2015
Hi all,

I have a question about setting the pin state in LPCXpresso54102 platform. What i would like to do is to set a pin high before a task is executed and set it back to low after the task has been executed. Right now I am doing it like this:

#define GPIO_PORT 1
#define GPIO_PIN 29

Chip_GPIO_SetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN, true);
delay();
bool temp1= Chip_GPIO_GetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN);
task();
Chip_GPIO_SetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN, false);
delay();
bool temp2= Chip_GPIO_GetPinState(LPC_GPIO, GPIO_PORT, GPIO_PIN);


The problem is that i check the values of temp1 and temp2 and they do not change at all. It is like the Chip_GPIO_SetPinState has no effect at all. Am I missing something? Thank you in advance!
Labels (1)
0 Kudos
1 Reply

389 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HCTEK on Tue Aug 04 02:31:29 MST 2015
Hello,

first you must configure the pin to a specific function. For your case it is the GPIO. Normally it is in the System Control Unit (SCU) registers.


Regards,
0 Kudos