Newbie LPC_PINCON->PINSEL clarification

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

Newbie LPC_PINCON->PINSEL clarification

1,518 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Hannes on Mon Jun 27 08:06:53 MST 2011
Good day

I am brand new with ARM microcontrollers and is still at the beginning of the learning curve.

I need to set P3_25 and 26 as GPIO outputs that are pulled low.

In the LPCXpresso included example code (LPCXpresso_Systick_Twinkle) I see that P0_22 is set up with:
LPC_PINCON->PINSEL1    &= (~(3 << 12)); // Set P0_22 to 00 - GPIO
I can not understand the link between PINSEL1 and P0_22. I can not find any documentation explaining this. The closest assumption I could make is that PINSEL0 holds the 32 bits to control the first 16pins, and that P0_22 would then start at the 12th bit of PINSEL1 because it is the 6th pin of the next group.

I can not figure out how that would translate when I want to switch on P3_25 and P3_26.

My
0 Kudos
4 Replies

1,012 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by chmielo13 on Fri Jun 05 11:34:39 MST 2015
I think it's page 117. Thank you very much Zero for getting me on the right track!
0 Kudos

1,012 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Hannes on Mon Jun 27 11:54:07 MST 2011
Thank you Zero :) . It seems I spent all my time looking for it in the wrong documents.
0 Kudos

1,012 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Jun 27 09:05:17 MST 2011

Quote:

...I can not understand the link between PINSEL1 and P0_22. I can not find any documentation...

In

http://www.nxp.com/documents/user_manual/UM10360.pdf

(Page 107) setting 2 bits in Pinsel0-10 to change pin function is explained.
0 Kudos

1,012 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Jun 27 08:18:31 MST 2011
Ehh...

I am trying to figure out which lpc1xxx you have.
If it is an lpx17xx variant you could try to peek in the lpx17xx user manual (downloadable from NXP's website) There you will find a table that tells you that bits 13 and 12 of the PINSEl1 register determine the function of P0_22.

So start by downloading the user manual for your chip and read it.
If you then still do not understand it, read it again.
If you [I][B]then[/B][/I] still do not understand, create a reply with information pointing us in the right direction to help you (i.e. which chip, where have you looked in the user manual, which example code are you using)

Regards,

Rob
0 Kudos