Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | How can I control GPIO port2/3?

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

How can I control GPIO port2/3? - janesleecn - May 7 10:16:00 2004

Hi, Dear all

I'm using a LPC2214 in my project. and have released P2.31:8 as a
GPIO but P2.7:0 as an external memory data bus. Strangely, I can't
control the behavior of P2.31:8 because I can't find PORT2's GPIO
register(IOPIN2,IODIR2..). How can I do this?

Thanks for your help!






(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: How can I control GPIO port2/3? - Bill Knight - May 7 10:20:00 2004

This works for me.

Regards
-Bill Knight
theARMPatch

///////////////////////////////////////////////////////////////////////////////
// General Purpose Input/Output Registers (GPIO)
typedef struct

REG32 in; // GPIO Value Register
REG32 set; // GPIO Output Set Register
REG32 dir; // GPIO Direction Register
REG32 clr; // GPIO Output Clear Register
} gpioRegs_t;

#define GPIO0 ((gpioRegs_t *)0xE0028000)
#define GPIO1 ((gpioRegs_t *)0xE0028010)
#define GPIO2 ((gpioRegs_t *)0xE0028020)
#define GPIO3 ((gpioRegs_t *)0xE0028030)

// GPIO Registers
#define IO0PIN GPIO0->in /* P0 Pin Value Register */
#define IO0SET GPIO0->set /* P0 Pin Output Set Register */
#define IO0DIR GPIO0->dir /* P0 Pin Direction Register */
#define IO0CLR GPIO0->clr /* P0 Pin Output Clear Register */
#define IO1PIN GPIO1->in /* P1 Pin Value Register */
#define IO1SET GPIO1->set /* P1 Pin Output Set Register */
#define IO1DIR GPIO1->dir /* P1 Pin Direction Register */
#define IO1CLR GPIO1->clr /* P1 Pin Output Clear Register */
#define IO2PIN GPIO2->in /* P2 Pin Value Register */
#define IO2SET GPIO2->set /* P2 Pin Output Set Register */
#define IO2DIR GPIO2->dir /* P2 Pin Direction Register */
#define IO2CLR GPIO2->clr /* P2 Pin Output Clear Register */
#define IO3PIN GPIO3->in /* P3 Pin Value Register */
#define IO3SET GPIO3->set /* P3 Pin Output Set Register */
#define IO3DIR GPIO3->dir /* P3 Pin Direction Register */
#define IO3CLR GPIO3->clr /* P3 Pin Output Clear Register */

On Fri, 07 May 2004 15:16:11 -0000, janesleecn wrote:

Hi, Dear all

I'm using a LPC2214 in my project. and have released P2.31:8 as a
GPIO but P2.7:0 as an external memory data bus. Strangely, I can't
control the behavior of P2.31:8 because I can't find PORT2's GPIO
register(IOPIN2,IODIR2..). How can I do this?

Thanks for your help!






(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: How can I control GPIO port2/3? - janesleecn - May 7 12:00:00 2004

Thanks!
I already found a header file from KEIL:
http://www.keil.com/dd/docs/arm/philips/lpc22xx.h

#define IOPIN2 (*((volatile unsigned long *) 0xE0028020))
#define IOSET2 (*((volatile unsigned long *) 0xE0028024))
#define IODIR2 (*((volatile unsigned long *) 0xE0028028))
#define IOCLR2 (*((volatile unsigned long *) 0xE002802C))
#define IOPIN3 (*((volatile unsigned long *) 0xE0028030))
#define IOSET3 (*((volatile unsigned long *) 0xE0028034))
#define IODIR3 (*((volatile unsigned long *) 0xE0028038))
#define IOCLR3 (*((volatile unsigned long *) 0xE002803C))

It's same as you. But I can't find any information about them on
philips's datasheet and user manual. It really be there and can be
access?

Regards

--Janeslee--

--- In , "Bill Knight" <BillK@t...> wrote:
> This works for me.
>
> Regards
> -Bill Knight
> theARMPatch
>
> ///////////////////////////////////////////////////////////////////
////////////
> // General Purpose Input/Output Registers (GPIO)
> typedef struct
>
> REG32 in; // GPIO Value Register
> REG32 set; // GPIO Output Set Register
> REG32 dir; // GPIO Direction Register
> REG32 clr; // GPIO Output Clear
Register
> } gpioRegs_t;
>
> #define GPIO0 ((gpioRegs_t *)0xE0028000)
> #define GPIO1 ((gpioRegs_t *)0xE0028010)
> #define GPIO2 ((gpioRegs_t *)0xE0028020)
> #define GPIO3 ((gpioRegs_t *)0xE0028030)
>
> // GPIO Registers
> #define IO0PIN GPIO0->in /* P0 Pin Value Register */
> #define IO0SET GPIO0->set /* P0 Pin Output Set
Register */
> #define IO0DIR GPIO0->dir /* P0 Pin Direction
Register */
> #define IO0CLR GPIO0->clr /* P0 Pin Output Clear
Register */
> #define IO1PIN GPIO1->in /* P1 Pin Value Register */
> #define IO1SET GPIO1->set /* P1 Pin Output Set
Register */
> #define IO1DIR GPIO1->dir /* P1 Pin Direction
Register */
> #define IO1CLR GPIO1->clr /* P1 Pin Output Clear
Register */
> #define IO2PIN GPIO2->in /* P2 Pin Value Register */
> #define IO2SET GPIO2->set /* P2 Pin Output Set
Register */
> #define IO2DIR GPIO2->dir /* P2 Pin Direction
Register */
> #define IO2CLR GPIO2->clr /* P2 Pin Output Clear
Register */
> #define IO3PIN GPIO3->in /* P3 Pin Value Register */
> #define IO3SET GPIO3->set /* P3 Pin Output Set
Register */
> #define IO3DIR GPIO3->dir /* P3 Pin Direction
Register */
> #define IO3CLR GPIO3->clr /* P3 Pin Output Clear
Register */ >
>
> On Fri, 07 May 2004 15:16:11 -0000, janesleecn wrote:
>
> Hi, Dear all
>
> I'm using a LPC2214 in my project. and have released P2.31:8 as a
> GPIO but P2.7:0 as an external memory data bus. Strangely, I can't
> control the behavior of P2.31:8 because I can't find PORT2's GPIO
> register(IOPIN2,IODIR2..). How can I do this?
>
> Thanks for your help!





(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: How can I control GPIO port2/3? - Bill Knight - May 7 13:53:00 2004

Yep. They are really there. I learned from Philips support
they forgot to put them in the manual.

-Bill On Fri, 07 May 2004 17:00:13 -0000, janesleecn wrote:

Thanks!
I already found a header file from KEIL:
http://www.keil.com/dd/docs/arm/philips/lpc22xx.h

#define IOPIN2 (*((volatile unsigned long *) 0xE0028020))
#define IOSET2 (*((volatile unsigned long *) 0xE0028024))
#define IODIR2 (*((volatile unsigned long *) 0xE0028028))
#define IOCLR2 (*((volatile unsigned long *) 0xE002802C))
#define IOPIN3 (*((volatile unsigned long *) 0xE0028030))
#define IOSET3 (*((volatile unsigned long *) 0xE0028034))
#define IODIR3 (*((volatile unsigned long *) 0xE0028038))
#define IOCLR3 (*((volatile unsigned long *) 0xE002803C))

It's same as you. But I can't find any information about them on
philips's datasheet and user manual. It really be there and can be
access?

Regards

--Janeslee--

--- In , "Bill Knight" <BillK@t...> wrote:
> This works for me.
>
> Regards
> -Bill Knight
> theARMPatch
>
> ///////////////////////////////////////////////////////////////////
////////////
> // General Purpose Input/Output Registers (GPIO)
> typedef struct
>
> REG32 in; // GPIO Value Register
> REG32 set; // GPIO Output Set Register
> REG32 dir; // GPIO Direction Register
> REG32 clr; // GPIO Output Clear
Register
> } gpioRegs_t;
>
> #define GPIO0 ((gpioRegs_t *)0xE0028000)
> #define GPIO1 ((gpioRegs_t *)0xE0028010)
> #define GPIO2 ((gpioRegs_t *)0xE0028020)
> #define GPIO3 ((gpioRegs_t *)0xE0028030)
>
> // GPIO Registers
> #define IO0PIN GPIO0->in /* P0 Pin Value Register */
> #define IO0SET GPIO0->set /* P0 Pin Output Set
Register */
> #define IO0DIR GPIO0->dir /* P0 Pin Direction
Register */
> #define IO0CLR GPIO0->clr /* P0 Pin Output Clear
Register */
> #define IO1PIN GPIO1->in /* P1 Pin Value Register */
> #define IO1SET GPIO1->set /* P1 Pin Output Set
Register */
> #define IO1DIR GPIO1->dir /* P1 Pin Direction
Register */
> #define IO1CLR GPIO1->clr /* P1 Pin Output Clear
Register */
> #define IO2PIN GPIO2->in /* P2 Pin Value Register */
> #define IO2SET GPIO2->set /* P2 Pin Output Set
Register */
> #define IO2DIR GPIO2->dir /* P2 Pin Direction
Register */
> #define IO2CLR GPIO2->clr /* P2 Pin Output Clear
Register */
> #define IO3PIN GPIO3->in /* P3 Pin Value Register */
> #define IO3SET GPIO3->set /* P3 Pin Output Set
Register */
> #define IO3DIR GPIO3->dir /* P3 Pin Direction
Register */
> #define IO3CLR GPIO3->clr /* P3 Pin Output Clear
Register */ >
>
> On Fri, 07 May 2004 15:16:11 -0000, janesleecn wrote:
>
> Hi, Dear all
>
> I'm using a LPC2214 in my project. and have released P2.31:8 as a
> GPIO but P2.7:0 as an external memory data bus. Strangely, I can't
> control the behavior of P2.31:8 because I can't find PORT2's GPIO
> register(IOPIN2,IODIR2..). How can I do this?
>
> Thanks for your help! Yahoo! Groups Links




(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )