Content originally posted in LPCWare by MarcVonWindscooting on Tue Mar 25 15:26:31 MST 2014
It is known, that GPIO clock is enabled on LPC812FD20, Rev 4C (current volume production) at least - in contradiction to the UM (1.3 at least). I did not believe and tried myself. It's true!
Although I like your style of 'minimally invasive' instructions (&=, |=, set, clear registers,...), I fear you run into problems that result from register (default) contents in contradiction to the UM.
Can you try with direct assignments of the config registers? Or at least check, whether the config registers you use are set as expected?
Welcome, by the way ;-)
UPDATE: I tried the following and it works:
** Failed to inline code **
Forget it. I never can inline code in this forum, I don't know why. One less than or greater than and all seems gone.
Find the file attached.
Something else must be wrong with your headers or your hardware device.
UPDATE again: As soon as I switch off IOCON clock, my P0_0 is dead, too. And I found why:
SYSAHBCLKCTRL bits 20..31: reserved.
What you read from reserved bits is undefined (random in the worst case). What you write has to be all 0s ! This is violated by SYSAHBCLKCTRL &= ~0 already.