EmbeddedRelated.com
Forums

Fast-IO not working with pre LPC2148 parts (which identifies as LPC2138...) ???

Started by Martin Maurer July 2, 2006
Hello,

i am using the following code:

main()
{
// Switch P1.16, P0.28, P0.29, P0.30 to output (2 x Duo-LED)
PINSEL1 &= ~(3 << ((28 - 16) << 1));
PINSEL1 &= ~(3 << ((29 - 16) << 1));
PINSEL1 &= ~(3 << ((30 - 16) << 1));
PINSEL2 &= ~0x0c;
#if 0
IODIR0 |= (1 << 28) | (1 << 29) | (1 << 30);
IODIR1 |= (1 << 16);
IOSET0 |= (1 << 28) | (1 << 29) | (1 << 30);
IOSET1 |= (1 << 16);
#endif // 0
#if 1
FIODIR0 |= (1 << 28) | (1 << 29) | (1 << 30);
FIODIR1 |= (1 << 16);
FIOSET0 |= (1 << 28) | (1 << 29) | (1 << 30);
FIOSET1 |= (1 << 16);
#endif // 0

while(1);
}
/* General Purpose Input/Output (GPIO) */
#define IOPIN IOPIN0
#define IOSET IOSET0
#define IODIR IODIR0
#define IOCLR IOCLR0
#define IOPIN0 (*((volatile unsigned long *) 0xE0028000))
#define IOSET0 (*((volatile unsigned long *) 0xE0028004))
#define IODIR0 (*((volatile unsigned long *) 0xE0028008))
#define IOCLR0 (*((volatile unsigned long *) 0xE002800C))
#define IOPIN1 (*((volatile unsigned long *) 0xE0028010))
#define IOSET1 (*((volatile unsigned long *) 0xE0028014))
#define IODIR1 (*((volatile unsigned long *) 0xE0028018))
#define IOCLR1 (*((volatile unsigned long *) 0xE002801C))

#define FIOPIN0 (*((volatile unsigned long *) 0x3FFFC014))
#define FIOSET0 (*((volatile unsigned long *) 0x3FFFC018))
#define FIODIR0 (*((volatile unsigned long *) 0x3FFFC000))
#define FIOCLR0 (*((volatile unsigned long *) 0x3FFFC01C))
#define FIOPIN1 (*((volatile unsigned long *) 0x3FFFC034))
#define FIOSET1 (*((volatile unsigned long *) 0x3FFFC038))
#define FIODIR1 (*((volatile unsigned long *) 0x3FFFC020))
#define FIOCLR1 (*((volatile unsigned long *) 0x3FFFC03C))

with ARM-ELF-GCC 3.4.3. When i enable the #if 0 for normal IO access it is working fine (LEDs light up). When i disable it and enable the #if 0 for Fast-IO no reaction at input pins (LEDs keep dark). I am using an old self build eval board where LPC2148 samples are mounted on, which identifies itself to boot loader as LPC2138, but USB is working fine (so it is no LPC2138).

Or is there any precondition to use Fast-IO ?

Has someone already seen a similar problem ? Any solution beside soldering a newer LPC2148 or is Fast-IO really not working in pre LPC2148 ? Or is the compiler doing me a problem, doing word / byte access instead, so i can't reach my bits ?

Regards,

Martin


An Engineer's Guide to the LPC2100 Series

You have to set the SCS register (0xE01FC1A0) to enable the fast I/O.
See 3.6 in the 2148 user manual.

*Peter*

Martin Maurer wrote:
with ARM-ELF-GCC 3.4.3. When i enable the #if 0 for normal IO access it
> is working fine (LEDs light up). When i disable it and enable the #if 0
> for Fast-IO no reaction at input pins (LEDs keep dark). I am using an
> old self build eval board where LPC2148 samples are mounted on, which
> identifies itself to boot loader as LPC2138, but USB is working fine (so
> it is no LPC2138).
>
> Or is there any precondition to use Fast-IO ?
>
> Has someone already seen a similar problem ? Any solution beside
> soldering a newer LPC2148 or is Fast-IO really not working in pre
> LPC2148 ? Or is the compiler doing me a problem, doing word / byte
> access instead, so i can't reach my bits ?

Hello Peter,

many thanks, that was the solution, i can access my port now via Fast-IO !

Regards,

Martin

----- Original Message -----
From: Peter Jakacki
To: l...
Sent: Sunday, July 02, 2006 1:46 PM
Subject: Re: [lpc2000] Fast-IO not working with pre LPC2148 parts (which
identifies as LPC2138...) ???
You have to set the SCS register (0xE01FC1A0) to enable the fast I/O.
See 3.6 in the 2148 user manual.

*Peter*

Martin Maurer wrote:
with ARM-ELF-GCC 3.4.3. When i enable the #if 0 for normal IO access it
> is working fine (LEDs light up). When i disable it and enable the #if 0
> for Fast-IO no reaction at input pins (LEDs keep dark). I am using an
> old self build eval board where LPC2148 samples are mounted on, which
> identifies itself to boot loader as LPC2138, but USB is working fine (so
> it is no LPC2138).
>
> Or is there any precondition to use Fast-IO ?
>
> Has someone already seen a similar problem ? Any solution beside
> soldering a newer LPC2148 or is Fast-IO really not working in pre
> LPC2148 ? Or is the compiler doing me a problem, doing word / byte
> access instead, so i can't reach my bits ?