Strange behaviour (to me). Can not configure pull up/down for LPC11C14

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

Strange behaviour (to me). Can not configure pull up/down for LPC11C14

973 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ian.holmes@xivix.eu on Mon May 11 08:08:50 MST 2015
I have a LPC11C14 and the keil dev environment.

I try to turn off the pullup resistor because I need to pull the line low when an input. I do this like this

LPC_IOCON->PIO1_9 = 0xE0;// Set up 1.9 as I/O not pullup/down, hyst on

and I'm using keil's PLX11xx.h file to define IOCON etc.

When I simulate the compiled application I can see that I have turned off the pull up and turned on hys, but when this hex file is downloaded to the target (via Flashmagic and email as the hardware isn't here with me)  the pullup still seems to be enabled.

So I add a printf to read the set up register for PIO1_9 ( uint32_t dummy; dummy = LPC_IOCON->PIO1_9; printf("%0x",dummy);) and the simulator serial window shows "0x0E". But when this is loaded onto the target it reports "0x0D".

Am I missing something obvious with the use of IOCONFIG for this register (0x40044038)?

It's almost as if the LPC11C14 doesn't have configurable pullups/downs

Thanks
Labels (1)
0 Kudos
Reply
6 Replies

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ian.holmes@xivix.eu on Thu May 14 00:29:50 MST 2015
What I was doing was to read and printf the config settings for the pins so I could see they were changing for these two, but not for the others. I was using the Keil simulator initially to check the code before I sent to to a collegue to test on the real target and I had to reconfigure P0.4 and P0.5 to make them work as GPIO. Subsequently I found the issue with the resistors and the fact that I had made an IOCONFIG change without the clock added to the confusion. I'm talking to nxp about this just to clarify if that should be expected from the documentation.

0 Kudos
Reply

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by 1234567890 on Tue May 12 08:47:07 MST 2015

Quote: ian.holmes@xivix.eu
Is there a description in the manual that explains how the clock is required by the various registers that you can point me at so I avoid more simple mistakes?



Figure 8 in the UM gives a good overview.
0 Kudos
Reply

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue May 12 03:56:06 MST 2015

Quote: ian.holmes@xivix.eu
....Is there a description in the manual that explains how the clock is required by the various registers that you can point me at so I avoid more simple mistakes?



It's always useful to check SYSAHBCLKCTRL settings. If you want to avoid mistakes it's a good idea to use working examples (especially if you are using CAN)  :)
0 Kudos
Reply

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Tue May 12 02:34:01 MST 2015
Have you checked that GPIO is the default function of P0.4 and P0.5?
0 Kudos
Reply

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ian.holmes@xivix.eu on Tue May 12 01:22:04 MST 2015
R2D2 - thanks. I was not enabling this (I made an error in myset up). This shows a bug in the simulator for the keil dev because it can change IOCONFIG without the clock enabled.

Something interesting here too, I was changing the setup of the I2C pins from I2C to GPIO successfully without enabling the IOCONFIG register clock. (Before I noted this pulldown problem I had my system working correctly with P0.4 and P0.5 set to GPIO).

Is there a description in the manual that explains how the clock is required by the various registers that you can point me at so I avoid more simple mistakes? At the moment the only reference to the IOCON clock in the manual I am using is for a description of bit 16 in the AHB system clock control register :

                   16                   IOCON                                   Enables clock for I/O configuration block.                      0
                                          0                                             Disable
                                          1                                             Enable

I've included that incase anyone else has this problem and searches for these words.
0 Kudos
Reply

954 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon May 11 08:15:52 MST 2015

Quote: ian.holmes@xivix.eu
Am I missing something obvious with the use of IOCONFIG for this register (0x40044038)?



IOCON bit of SYSAHBCLKCTRL  :quest:
0 Kudos
Reply