How to config IOCON register

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

How to config IOCON register

1,124 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuongnamvn_90 on Tue Jul 12 21:54:59 MST 2011
how i can write to IOCONFIG register to config Pin as function GPIO/peripheral and mode ...
ex:Pin P1_0
0 Kudos
9 Replies

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 13 07:16:28 MST 2011
Or UM10398 LPC111x/LPC11Cxx User manual [COLOR=Red]Rev. 5[/COLOR] — 21 June 2011 :eek::eek:

http://www.nxp.com/documents/user_manual/UM10398.pdf
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Wed Jul 13 07:03:16 MST 2011
I'll make it easier ... go into the examples folder, which will be something like the following:

C:\nxp\LPCXpresso_4.0.5_123\lpcxpresso\Examples\NXP\LPC1000\LPC11xx

and unzip the file "NXP_LPCXpresso1114-302_2011-02-07"

Inside this zip file you have all kinds of examples, and you just need to search for IOCON.  For example, open:

i2c/driver/ssp.c

and look at lines 134 and following.

If you want to understand what 0x07 and 0x01 mean, you'll have to look in the user manual (which I'll provide here if you can't find it):

http://ics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc11xx.lpc11cxx.pdf

Look at section 7.4 (p.59).

You can see the bits that you need to set for each pin to control the functionality of the pin, the internal pullup, and potentially other settings.

Try (seriously) to understand some of that first, and if you have questions that show you're making a (serious) effort to understand, I'm sure people (myself included) will be happy to help.  But just asking for answers that you can easily find yourself isn't helping you or anyone else, even if I could have given you the answer with far less effort than the above reply.
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Wed Jul 13 06:46:56 MST 2011

Quote: phuongnamvn_90
LPCXpresso IDE
board LPC1114/301



Honestly, you should really put some effort and thought into this yourself.  It seems you're just waiting for people to spoon feed you an answer you can very easily find in the existing examples.

Just do a text search in the examples folder for "IOCON".

If you've made a small effort to understand how IOCON works, people here are happy to help beginners ... but no one would be 'helping' you by doing all of the work for you with zero effort to understand and learn things for yourself.

You need to do some thinking yourself before you can "think outside the box". ;)
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuongnamvn_90 on Wed Jul 13 04:49:33 MST 2011
LPCXpresso IDE
board LPC1114/301
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 13 04:46:18 MST 2011
Which error?

BTW: Which LPC are we talking about?

Could be:

LPC_IOCON->R_PIO1_0=0x0000;
Do you know that this IOCON struct is defined in your LPCxxxx.h ?
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuongnamvn_90 on Wed Jul 13 04:39:18 MST 2011
can U check it again,i've try the command:"LPC_IOCON->PIO1_0=0x0000;" but LPCXPresso reports an error
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 13 04:29:44 MST 2011
LPC_IOCON->PIO1_0   = value;
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuongnamvn_90 on Wed Jul 13 04:20:48 MST 2011
Oh,I've look up example but I can find it.Do you know,can you tell me the command do it
0 Kudos

926 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Wed Jul 13 01:35:06 MST 2011
Why don't you look up the examples?
0 Kudos