Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: KICK me a bit to START (LPC22xx)

2005-12-21 by Carsten

Hello.
Here are some helping stuff:

/****************** define PortPin-Bits ***********/
#define PINSEL_BITPIN0  0
#define PINSEL_BITPIN1  2
#define PINSEL_BITPIN2  4
#define PINSEL_BITPIN3  6
#define PINSEL_BITPIN4  8
#define PINSEL_BITPIN5  10
.
.
#define PINSEL_BITPIN15  30
/**************************************************/

/************* define Pin-Function-Bits ***********/
#define PINSEL_FIRST_ALT_FUNC  1
#define PINSEL_SECOND_ALT_FUNC 2
#define PINSEL_THIRD_ALT_FUNC  3
#define PINSEL_4TH_ALT_FUNC    4
/**************************************************/

/******* use for uart0 and uart1 for example ******/
// Values of Bits 0-3 in PINSEL to activate UART0
#define UART0_PINSEL   
((PINSEL_FIRST_ALT_FUNC<<PINSEL_BITPIN0)|(PINSEL_FIRST_ALT_FUNC<<PINSEL_BITPIN1))

// Values of Bits 16-19 in PINSEL to activate UART1
#define UART1_PINSEL   
((PINSEL_FIRST_ALT_FUNC<<PINSEL_BITPIN8)|(PINSEL_FIRST_ALT_FUNC<<PINSEL_BITPIN9))

// Mask of Bits 0-3
#define UART0_PINMASK      (0x0000000F)    /* PINSEL0 Mask for UART0 */
// Mask of Bits 16-19
#define UART1_PINMASK      (0x00000F00)    /* PINSEL0 Mask for UART0 */
/**************************************************/

/**************** set PINSEL **********************/
  PCB_PINSEL0 = (PCB_PINSEL0 & ~UART0_PINMASK) | UART0_PINSEL;
  PCB_PINSEL0 = (PCB_PINSEL0 & ~UART1_PINMASK) | UART1_PINSEL;
/**************************************************/

regards 
carsten


> Thank you very much!
> That means if I want to enable p0.9 then i would write 0x00000200 
> (0x0000 0000 0000 0000 0000 0010 0000 0000)...Am I right??
> 
> Then what for p1.25 or p3.4 or other pins? How would I initialize 
> those pins in this way?
> 
> Would you please send me a link where it is already explained? 
> 
> Thank you.
> 
> --- In lpc2000@yahoogroups.com, "rtstofer" <rstofer@p...> wrote:
> >
> > 
> > 0x00000100 represents 8 4-bit hex digits, 32 bits in all.  The right 
> > two digits represent the bits 0..7 so the 1 in the next digit is bit 
> > 8 of 32 and it would set P0.8 to a 1.
> > 
> > To clear P0.8 do:
> > 
> > IO0CLR = 0x00000100;
> > 
> > --- In lpc2000@yahoogroups.com, "mahbub1833" <fireball003@g...> 
> > wrote:
> > >
> > > Hi, 
> > > Very newbie problem. Sorry for that. 
> > > 	
> > > 
> > > IO0SET = 0x00000100; /* Turn LED Off (P0.8 = 1) */ 
> > > 	
> > > 
> > > I didn't get the 0x00000100 in datasheet. What does it mean? How 
> > would 
> > > I understand other pin configerations as well? Please tell this 
> > newbie 
> > > in details. 
> > > 
> > > Thanks in advance.
> > >
> >

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.