Set a bit to 0

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

Set a bit to 0

751 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jb_mrush on Fri Jul 13 14:06:43 MST 2012
Hello everyone,
I'm trying to set a bit to 0 with GPIOSetValue

GPIOSetValue( 1, 3, 0) for example.

The program is running great, my GPIOSetDir are good but when I run the program step by step, the pin always stay to 1 (3.2V) on the Voltmeter.

If I link the pin manually (with a wire) to the GND, all is working well.

Is there something to set on the program...I tried with GPIOSetDir on 1 or 0 but still don't work .
Thanks
0 Kudos
Reply
2 Replies

742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gabriellobao on Tue Jul 17 07:33:55 MST 2012
I've found a problem like tahat. In the BaseBoard, that same pin PIO1_2, just can't be cleared by software.

I'm trying an application with the RGB led, and this pin controlls the blue color. The blue led never goes off.

I think that happen because of the ADC, and i don't know how desable ADC function fot that pin.

Can someone help me? :)
0 Kudos
Reply

742 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Fri Jul 13 16:41:52 MST 2012

Quote:
If I link the pin manually (with a wire) to the GND, all is working well.


Umm, you're forcing a pin that's high to GND with a wire? That's a good way to kill your processor.

As for your problem I had a similar issue the other day and it turned out to be that I wasn't enabling the GPIO clock. For the LPC1227 the code to do so is

LPC_SYSCON->SYSAHBCLKCTRL |= (1<<31);

but the bit position is different for other processors.
0 Kudos
Reply