EmbeddedRelated.com
Forums

Driving LEDs directly from LPC2378

Started by Bruce Marshall August 28, 2009
Bruce Marshall wrote:
> 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.

The voltages are too low. Port pins should be able to drive at least
2.9V. If you had only a weak pull-up driving the leds, that would
explain the 1.6V which roughly matches the forward voltages of the leds.
So maybe the obvious checks are in order:

Did you measure from the port pin of the microcontroller to ground?
(1.9V makes me think that you measured just from the anode to the
cathode of the leds)

What is your supply voltage? Have you checked it?

Have you set the leds on by actually writing into the IOPIN, IOSET or
IOCLR (or FIOPIN, FIOSET or FIOCLR) registers?

Have you properly selected right GPIO access mode? (I'll bet on this one)

--

Timo

An Engineer's Guide to the LPC2100 Series

I have solved the problem.

It was all down to using a bad version of LPC23xx.h which had come from lwIP some years ago.

The defines for FIOxDIRy were all accessing a location 1 higher in memory. The result was that some ports were defaulting to input when output was expected.

Check your LPC23xx.h include file, folks.
--- On Tue, 1/9/09, Bruce Marshall wrote:
From: Bruce Marshall
Subject: Re: [lpc2000] Re: Driving LEDs directly from LPC2378
To: l..., b...@theiet.org
Date: Tuesday, 1 September, 2009, 2:20 PM


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: lpc2000@yahoogroups .com
> 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: lpc2000@yahoogroups .com
> 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
> >
> >
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>