EmbeddedRelated.com
Forums

Driving LEDs directly from LPC2378

Started by Bruce Marshall August 28, 2009
On my LPC2378 board I am unable to turn on LEDs directly from SOME of the GPIO pins.

P0.8 - P0.15 fails PINMODE0 set for pull-up
P0.16 - P0.23 OK PINMODE1 set for pull-up

P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)

P4.0 - P4.15 OK PINMODE8 set for pull-up

The PINSEL registers are set for GPIO on these pins. FIODIR registers are set for outputs. I've checked and rechecked!

I believe the GPIO outputs can drive 4mA, so why do some ports work and others not? The problem exists on a number of boards which makes me think there is some feature of the LPC2378 which I have missed.

thanks
Bruce

An Engineer's Guide to the LPC2100 Series

Hi:

1. Is the problem exactly the same in all failing boards? (That is, the same pin(s) fail from board to board?)

2. Are you actually writing the correct value to the pin? (That is, are you writing 1 to the P0.8 - P0.15? ) (not only the direction registers have to be configured, but you have to write to the port as well).

Note that the pull up/pull down resistors are only of any functionality when the pin is configured as input. When the pin is configured as an output, the pull up/pull down resistors are simply in parallel to your LEDs, but not driving them (in fact, they are draining some current)

3. Are your LEDs installed correctly? With the correct current limiting resisitor?

Regards,

Alex
--- In l..., Bruce Marshall wrote:
>
> On my LPC2378 board I am unable to turn on LEDs directly from SOME of the GPIO pins.
>
> P0.8 - P0.15 fails PINMODE0 set for pull-up
> P0.16 - P0.23 OK PINMODE1 set for pull-up
>
> P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
>
> P4.0 - P4.15 OK PINMODE8 set for pull-up
>
> The PINSEL registers are set for GPIO on these pins. FIODIR registers are set for outputs. I've checked and rechecked!
>
> I believe the GPIO outputs can drive 4mA, so why do some ports work and others not? The problem exists on a number of boards which makes me think there is some feature of the LPC2378 which I have missed.
>
> thanks
> Bruce
>
I've had the same problem, also the whole P4 doesn't work propely..

after a lot of research I found that there is a "really hard" configuration
that must be done in order to get these ports working.

You must to deactivate the trace suport peripherical by issuing this
command:
PINSEL10 =0 ;

hehe.. one line only, and months of headache it has given me.

cya.

2009/8/28 Bruce Marshall

> On my LPC2378 board I am unable to turn on LEDs directly from SOME of the
> GPIO pins.
>
> P0.8 - P0.15 fails PINMODE0 set for pull-up
> P0.16 - P0.23 OK PINMODE1 set for pull-up
>
> P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
>
> P4.0 - P4.15 OK PINMODE8 set for pull-up
>
> The PINSEL registers are set for GPIO on these pins. FIODIR registers are
> set for outputs. I've checked and rechecked!
>
> I believe the GPIO outputs can drive 4mA, so why do some ports work and
> others not? The problem exists on a number of boards which makes me think
> there is some feature of the LPC2378 which I have missed.
>
> thanks
> Bruce
>


Hi:

Note that the bit 3 of PINSEL10 is read from RTCK signal in the JTAG connector at reset time, and that is recommended to have a 10k pull-up resistor on this pin. This could have prevented your problems.

However, it is not a bad idea to set PINSEL10 at power up.

The ETM is connected to P2.0 to P2.9, and these pins are not the ones that the OT mentioned have problems.

P4.0-P4.15 are used by the External Memory address controller. This could be an indication of where the problem is...

Regards,

--- In l..., Felipe de Andrade Neves Lavratti wrote:
>
> I've had the same problem, also the whole P4 doesn't work propely..
>
> after a lot of research I found that there is a "really hard" configuration
> that must be done in order to get these ports working.
>
> You must to deactivate the trace suport peripherical by issuing this
> command:
> PINSEL10 =0 ;
>
> hehe.. one line only, and months of headache it has given me.
>
> cya.
>
> 2009/8/28 Bruce Marshall >
> >
> > On my LPC2378 board I am unable to turn on LEDs directly from SOME of the
> > GPIO pins.
> >
> > P0.8 - P0.15 fails PINMODE0 set for pull-up
> > P0.16 - P0.23 OK PINMODE1 set for pull-up
> >
> > P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
> >
> > P4.0 - P4.15 OK PINMODE8 set for pull-up
> >
> > The PINSEL registers are set for GPIO on these pins. FIODIR registers are
> > set for outputs. I've checked and rechecked!
> >
> > I believe the GPIO outputs can drive 4mA, so why do some ports work and
> > others not? The problem exists on a number of boards which makes me think
> > there is some feature of the LPC2378 which I have missed.
> >
> > thanks
> > Bruce
> >
> >
> >
>
>
Yes alexander! The lpc2378 that I was experiencing the problems above was
from a platform that I made myself, and I left the jtag pins not connected.

Actually, until few months ago I didn't know the existence of PINSEL10.
2009/8/28 alexander_ribero

> Hi:
>
> Note that the bit 3 of PINSEL10 is read from RTCK signal in the JTAG
> connector at reset time, and that is recommended to have a 10k pull-up
> resistor on this pin. This could have prevented your problems.
>
> However, it is not a bad idea to set PINSEL10 at power up.
>
> The ETM is connected to P2.0 to P2.9, and these pins are not the ones that
> the OT mentioned have problems.
>
> P4.0-P4.15 are used by the External Memory address controller. This could
> be an indication of where the problem is...
>
> Regards,
> --- In l... , Felipe de
> Andrade Neves Lavratti wrote:
> >
> > I've had the same problem, also the whole P4 doesn't work propely..
> >
> > after a lot of research I found that there is a "really hard"
> configuration
> > that must be done in order to get these ports working.
> >
> > You must to deactivate the trace suport peripherical by issuing this
> > command:
> > PINSEL10 =0 ;
> >
> > hehe.. one line only, and months of headache it has given me.
> >
> > cya.
> >
> >
> >
> > 2009/8/28 Bruce Marshall
> >
> > >
> > >
> > > On my LPC2378 board I am unable to turn on LEDs directly from SOME of
> the
> > > GPIO pins.
> > >
> > > P0.8 - P0.15 fails PINMODE0 set for pull-up
> > > P0.16 - P0.23 OK PINMODE1 set for pull-up
> > >
> > > P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
> > >
> > > P4.0 - P4.15 OK PINMODE8 set for pull-up
> > >
> > > The PINSEL registers are set for GPIO on these pins. FIODIR registers
> are
> > > set for outputs. I've checked and rechecked!
> > >
> > > I believe the GPIO outputs can drive 4mA, so why do some ports work and
> > > others not? The problem exists on a number of boards which makes me
> think
> > > there is some feature of the LPC2378 which I have missed.
> > >
> > > thanks
> > > Bruce
> > >
> > >
> > >
> >
> >
> >
> >
>


--- In l..., Bruce Marshall wrote:
>
> On my LPC2378 board I am unable to turn on LEDs directly from SOME of the GPIO pins.
>
> P0.8 - P0.15 fails PINMODE0 set for pull-up
> P0.16 - P0.23 OK PINMODE1 set for pull-up
>
> P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
>
> P4.0 - P4.15 OK PINMODE8 set for pull-up
>
> The PINSEL registers are set for GPIO on these pins. FIODIR registers are set for outputs. I've checked and rechecked!
>
> I believe the GPIO outputs can drive 4mA, so why do some ports work and others not? The problem exists on a number of boards which makes me think there is some feature of the LPC2378 which I have missed.
>
> thanks
> Bruce
>

Are the output pins actually putting a voltage across the LED ? You might want to check with a meter or scope.

If so, then could it be that the LED you are trying to turn on has too high of a voltage drop ? Maybe one of those LED colors (blue?) that requires a higher voltage to make it draw current ?

boB
If you mesure two volts when writing '1' at these ports then PINSEL10=0
should solve it.

2009/8/29 bobtransformer

> --- In l... , Bruce Marshall
> wrote:
> >
> > On my LPC2378 board I am unable to turn on LEDs directly from SOME of the
> GPIO pins.
> >
> > P0.8 - P0.15 fails PINMODE0 set for pull-up
> > P0.16 - P0.23 OK PINMODE1 set for pull-up
> >
> > P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
> >
> > P4.0 - P4.15 OK PINMODE8 set for pull-up
> >
> > The PINSEL registers are set for GPIO on these pins. FIODIR registers
> are set for outputs. I've checked and rechecked!
> >
> > I believe the GPIO outputs can drive 4mA, so why do some ports work and
> others not? The problem exists on a number of boards which makes me think
> there is some feature of the LPC2378 which I have missed.
> >
> > thanks
> > Bruce
> > Are the output pins actually putting a voltage across the LED ? You might
> want to check with a meter or scope.
>
> If so, then could it be that the LED you are trying to turn on has too high
> of a voltage drop ? Maybe one of those LED colors (blue?) that requires a
> higher voltage to make it draw current ?
>
> boB
>
>
>


Thanks for the various suggestions. ... but

PINSEL10 was already 0. There was no pull-up for RTCK, but pulling up using a 10kR made no difference.

PINMODE registers were set for pull-ups. Changed this to no pulling, which has not fixed the problem.

PCONP was not initialised. Changed this to disable unused peripherals. No fix for problem.

All LED's (type HLMP-1700) have a 620R resistor in series.

The only new observations I have made are that if I output x55 to P0.8 - P0.15 then on a scope I see the pattern x48 at the LEDs, but the LEDs are not lit. The voltage across P0.4 and P0.5 is 1.6 volts. On the other ports which do work I see 1.9 volts.

thanks again
Bruce
--- On Sat, 29/8/09, Felipe de Andrade Neves Lavratti wrote:
From: Felipe de Andrade Neves Lavratti
Subject: Re: [lpc2000] Re: Driving LEDs directly from LPC2378
To: l...
Date: Saturday, 29 August, 2009, 7:40 PM


If you mesure two volts when writing '1' at these ports then PINSEL10=0
should solve it.

2009/8/29 bobtransformer

> --- In lpc2000@yahoogroups .com , Bruce Marshall
> wrote:
> >
> > On my LPC2378 board I am unable to turn on LEDs directly from SOME of the
> GPIO pins.
> >
> > P0.8 - P0.15 fails PINMODE0 set for pull-up
> > P0.16 - P0.23 OK PINMODE1 set for pull-up
> >
> > P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
> >
> > P4.0 - P4.15 OK PINMODE8 set for pull-up
> >
> > The PINSEL registers are set for GPIO on these pins. FIODIR registers
> are set for outputs. I've checked and rechecked!
> >
> > I believe the GPIO outputs can drive 4mA, so why do some ports work and
> others not? The problem exists on a number of boards which makes me think
> there is some feature of the LPC2378 which I have missed.
> >
> > thanks
> > Bruce
> > Are the output pins actually putting a voltage across the LED ? You might
> want to check with a meter or scope.
>
> If so, then could it be that the LED you are trying to turn on has too high
> of a voltage drop ? Maybe one of those LED colors (blue?) that requires a
> higher voltage to make it draw current ?
>
> boB
>
>
>



Correction - I'm referring to Green LEDs type HLMP-1790

--- On Tue, 1/9/09, Bruce Marshall wrote:

> From: Bruce Marshall
> Subject: Re: [lpc2000] Re: Driving LEDs directly from LPC2378
> To: l...
> Date: Tuesday, 1 September, 2009, 2:12 PM
> Thanks for the various suggestions.
> ... but
>
> PINSEL10 was already 0. There was no pull-up for
> RTCK, but pulling up using a 10kR made no difference.
>
> PINMODE registers were set for pull-ups. Changed this to no
> pulling, which has not fixed the problem.
>
> PCONP was not initialised. Changed this to disable
> unused peripherals. No fix for problem.
>
> All LED's (type HLMP-1700) have a 620R resistor in series.
>
> The only new observations I have made are that if I output
> x55 to P0.8 - P0.15 then on a scope I see the pattern x48 at
> the LEDs, but the LEDs are not lit. The voltage across
> P0.4 and P0.5 is 1.6 volts. On the other ports which
> do work I see 1.9 volts.
>
> thanks again
> Bruce
> --- On Sat, 29/8/09, Felipe de Andrade Neves Lavratti
>
> wrote:
>
>
> From: Felipe de Andrade Neves Lavratti
> Subject: Re: [lpc2000] Re: Driving LEDs directly from
> LPC2378
> To: l...
> Date: Saturday, 29 August, 2009, 7:40 PM
>
>
>
>
>
>
> If you mesure two volts when writing '1' at these ports
> then PINSEL10=0
> should solve it.
>
> 2009/8/29 bobtransformer
>
> >
> >
> > --- In lpc2000@yahoogroups .com > ups.com>, Bruce Marshall
> > wrote:
> > >
> > > On my LPC2378 board I am unable to turn on LEDs
> directly from SOME of the
> > GPIO pins.
> > >
> > > P0.8 - P0.15 fails PINMODE0 set for pull-up
> > > P0.16 - P0.23 OK PINMODE1 set for pull-up
> > >
> > > P1.24 - P1.31 fails PINMODE3 set for pull-down
> (LEDs connected to 3V3)
> > >
> > > P4.0 - P4.15 OK PINMODE8 set for pull-up
> > >
> > > The PINSEL registers are set for GPIO on these
> pins. FIODIR registers
> > are set for outputs. I've checked and rechecked!
> > >
> > > I believe the GPIO outputs can drive 4mA, so why
> do some ports work and
> > others not? The problem exists on a number of boards
> which makes me think
> > there is some feature of the LPC2378 which I have
> missed.
> > >
> > > thanks
> > > Bruce
> > >
> >
> > Are the output pins actually putting a voltage across
> the LED ? You might
> > want to check with a meter or scope.
> >
> > If so, then could it be that the LED you are trying to
> turn on has too high
> > of a voltage drop ? Maybe one of those LED colors
> (blue?) that requires a
> > higher voltage to make it draw current ?
> >
> > boB
> >
> >
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

How did you come up with 680 ohms in series?
Have you tried lowering the resistance to 160 ohms?
What is the Vf needed on a GREEN LED to get photons emitted?
Do you have anything else tied to these ports (I am assuming PORT-LED_ANODE-LED_CATHODE-RESISTOR-GND is the circuit).

--- In l..., Bruce Marshall wrote:
>
> On my LPC2378 board I am unable to turn on LEDs directly from SOME of the GPIO pins.
>
> P0.8 - P0.15 fails PINMODE0 set for pull-up
> P0.16 - P0.23 OK PINMODE1 set for pull-up
>
> P1.24 - P1.31 fails PINMODE3 set for pull-down (LEDs connected to 3V3)
>
> P4.0 - P4.15 OK PINMODE8 set for pull-up
>
> The PINSEL registers are set for GPIO on these pins. FIODIR registers are set for outputs. I've checked and rechecked!
>
> I believe the GPIO outputs can drive 4mA, so why do some ports work and others not? The problem exists on a number of boards which makes me think there is some feature of the LPC2378 which I have missed.
>
> thanks
> Bruce
>