lpcware

Problem with Chip_GPIO_SetPinState

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
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!

Outcomes