>
> for(;;)
> {
> FIO0SET |= (1<<26); // set speaker
> FIO2SET |= (1<<10); // set led
> delayMs(1);
> FIO0CLR |= (1<<26); // reset speaker
> FIO2CLR |= (1<<10); // reset led
> delayMs(1);
> }
>
> has anyone an idea why this does not work?
> Blimey, this question comes up nearly every day!!!
FIOxSET and FIOxCLR are read only registers, you can't use |=. You just use
=.
If you were using the FIOxPIN registers you'd use |= so you don't
affect the other pins but SET and CLR ignore the bits which are 0.
Have you set up the SCS to enable fast IO on ports 0 and 1? I don't see it
in your code.
The older LPC parts had different performance/timings on these ports, so they
can operate in two modes to stay backwards compatible or provide increase
performance.
Unless high speed IO is enabled, these ports won't work properly with the
FIO0xxx and FIO1xxx registers.
You can either set bit 0 of SCS (0xe01fc1a0) to 1, or use the old IO interface
for those ports (IO0xxx and IO1xxx)
You also shouldn't use |= on the FIOxSET and FIOxCLR registers. Have a
re-read of chapter 10 of the user manual. For example:
To set the speaker pin high:
FIO0SET = (1 << 26);
To set the speaker pin low:
FIO0CLR = (1 << 26);
Regards,
Nathan.
----- Original Message -----
From: Philipp Brejcha
To: l...
Sent: Saturday, September 25, 2010 2:11 AM
Subject: [lpc2000] how to Toggle port 0.26
Hi everyone,
we bought a Evalboard from Embedded Artist (LPC2478 and the QVGA baseboard)
but we are not able to toggle the port 0.26. There is no jumper, because if we
run the demo application (which is only available as *.hex) the speaker
(connected to P0.26) makes a sound.
I set the PINSEL to 0x0 (GPIO mode)
The PINMODE to 0x0 (Pull up)
and the direction to output:
for(;;)
{
FIO0SET |= (1<<26); // set speaker
FIO2SET |= (1<<10); // set led
delayMs(1);
FIO0CLR |= (1<<26); // reset speaker
FIO2CLR |= (1<<10); // reset led
delayMs(1);
}
has anyone an idea why this does not work?
has anyone a working code for the pin 0.26?
It seems like there are some extra settings necessary for port 0 and port 1,
but i have not found them yet...
does anyone know which?
greetings,
philipp
Reply by Philipp Brejcha●September 27, 20102010-09-27
That was the mistake!
Thank you very much!
Greetings,
Philipp
On Mon, Sep 27, 2010 at 10:22 AM, wrote:
> Philipp Brejcha wrote:
> > ... but we are not able to toggle the port 0.26...
>
> > It seems like there are some extra settings necessary for port 0...
>
> GPIOM? (3-3.4.1 in User Manual)
>
> --
>
> Timo
>
>
>
Reply by tike...@gmail.com●September 27, 20102010-09-27
Philipp Brejcha wrote: > ... but we are not able to toggle the port 0.26...
> It seems like there are some extra settings necessary
for port 0...
GPIOM? (3-3.4.1 in User Manual)
--
Timo
Reply by Philipp Brejcha●September 24, 20102010-09-24
Hi everyone,
we bought a Evalboard from Embedded Artist (LPC2478 and the QVGA baseboard)
but we are not able to toggle the port 0.26. There is no jumper, because if
we run the demo application (which is only available as *.hex) the speaker
(connected to P0.26) makes a sound.
I set the PINSEL to 0x0 (GPIO mode)
The PINMODE to 0x0 (Pull up)
and the direction to output: