Discussion group dedicated to the Philips LPC2000 family of ARM MCUs
Simple GPIO not working completey?! - active_si - Mar 24 0:36:58 2009
Hi!
I have a MCB2300 board and I'm playing around with simple GPIO input/output.
If I extend the blinky example from keil so that the P2.8 is also "blinking" it works, but
if I want to expand it so that any pin from the P0 would blink or take input it doesn't
work.
Also in the uVision debuger when I observe the Fast GPIO Port 0 and Fast GPIO Port 2 there
is the difference where the P0 has FIO0PIN all set to 0 and FIO2PIN is all set to 1.
A little code I use:
-- initialization code --
PINSEL10 = 0; /* Disable ETM interface */
FIO0DIR = 0; // reset everything to input
FIO2DIR = 0; // reset everything to input
FIO0DIR = 0x00000C00; // set bit 10 and 11 to output
FIO2DIR = 0x000001FF; /* P2.0..8 defined as Outputs */
FIO2MASK = 0x00000000;
FIO0MASK = 0x00000000;
-------------------------
-- switching code --
Switch ON:
FIO2SET = 0x00000100; // P2.8
FIO0SET = 0x00000400; // P0.10
FIO0SET = 0x00000800; // P0.11
Switch OFF:
FIO2CLR = 0x00000100; // P2.8
FIO0CLR = 0x00000400; // P0.10
FIO0CLR = 0x00000800; // P0.11
---------------------
from this the P2.8 works (pin 93 on LPC2378) but P0.10(pin69) and P0.11(pin70) don't
change their state.
Am I missing something? I reviewed the MCB2300 schematics and I couldn't find anything
connected to this pins so there shouldn't be any problems.
Any help would be appriciated as to why the P0 doesn't work for me.
Thanks!
Re, Uros
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: Simple GPIO not working completey?! - rolf_meeser - Mar 24 4:14:22 2009
Hi Uros,
--- In l...@yahoogroups.com, "active_si"
wrote:
> If I extend the blinky example from keil so that the P2.8 is also "blinking" it works,
but if I want to expand it so that any pin from the P0 would blink or take input it
doesn't work.
>
Do you set bit 0 in the SCS register?
While it's cleared (the default) you don't have access to port 0 and 1 through the fast
I/O mode registers.
Regards,
Rolf
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )RE: Simple GPIO not working completey?! - Paul Curtis - Mar 24 4:55:44 2009
Hi,
> Hi!
>
> I have a MCB2300 board and I'm playing around with simple GPIO
> input/output.
>
> If I extend the blinky example from keil so that the P2.8 is also
> "blinking" it works, but if I want to expand it so that any pin from the
P0
> would blink or take input it doesn't work.
>
> Also in the uVision debuger when I observe the Fast GPIO Port 0 and Fast
> GPIO Port 2 there is the difference where the P0 has FIO0PIN all set to 0
> and FIO2PIN is all set to 1.
>
> A little code I use:
> -- initialization code --
> PINSEL10 = 0; /* Disable ETM interface */
> FIO0DIR = 0; // reset everything to input
> FIO2DIR = 0; // reset everything to input
> FIO0DIR = 0x00000C00; // set bit 10 and 11 to output
> FIO2DIR = 0x000001FF; /* P2.0..8 defined as Outputs */
> FIO2MASK = 0x00000000;
> FIO0MASK = 0x00000000;
> -------------------------
> -- switching code --
> Switch ON:
> FIO2SET = 0x00000100; // P2.8
> FIO0SET = 0x00000400; // P0.10
> FIO0SET = 0x00000800; // P0.11
> Switch OFF:
> FIO2CLR = 0x00000100; // P2.8
> FIO0CLR = 0x00000400; // P0.10
> FIO0CLR = 0x00000800; // P0.11
> ---------------------
>
> from this the P2.8 works (pin 93 on LPC2378) but P0.10(pin69) and
> P0.11(pin70) don't change their state.
>
> Am I missing something? I reviewed the MCB2300 schematics and I couldn't
> find anything connected to this pins so there shouldn't be any problems.
>
> Any help would be appriciated as to why the P0 doesn't work for me.
You need to enable Fast I/O on the legacy GPIO ports 0 and 1. Look at the
SCS register.
It's a gotcha every time... NXP should nuke those legacy ports.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: Simple GPIO not working completey?! - Solved - active_si - Mar 24 5:44:29 2009
Thanks to Paul and Rolf the problem is now solved,
the "SCS |= 0x00000001;" solved the problem. Now the Port0 is also responding the FIO
changes.
And yes it's a bit that is easily overlooked as Paul said.
Thank again guys!
Re, Uros
--- In l...@yahoogroups.com, "active_si"
wrote:
>
> Hi!
>
> I have a MCB2300 board and I'm playing around with simple GPIO input/output.
>
> If I extend the blinky example from keil so that the P2.8 is also "blinking" it works,
but if I want to expand it so that any pin from the P0 would blink or take input it
doesn't work.
>
> Also in the uVision debuger when I observe the Fast GPIO Port 0 and Fast GPIO Port 2
there is the difference where the P0 has FIO0PIN all set to 0 and FIO2PIN is all set to
1.
>
> A little code I use:
> -- initialization code --
> PINSEL10 = 0; /* Disable ETM interface */
> FIO0DIR = 0; // reset everything to input
> FIO2DIR = 0; // reset everything to input
> FIO0DIR = 0x00000C00; // set bit 10 and 11 to output
> FIO2DIR = 0x000001FF; /* P2.0..8 defined as Outputs */
> FIO2MASK = 0x00000000;
> FIO0MASK = 0x00000000;
> -------------------------
> -- switching code --
> Switch ON:
> FIO2SET = 0x00000100; // P2.8
> FIO0SET = 0x00000400; // P0.10
> FIO0SET = 0x00000800; // P0.11
> Switch OFF:
> FIO2CLR = 0x00000100; // P2.8
> FIO0CLR = 0x00000400; // P0.10
> FIO0CLR = 0x00000800; // P0.11
> ---------------------
>
> from this the P2.8 works (pin 93 on LPC2378) but P0.10(pin69) and P0.11(pin70) don't
change their state.
>
> Am I missing something? I reviewed the MCB2300 schematics and I couldn't find anything
connected to this pins so there shouldn't be any problems.
>
> Any help would be appriciated as to why the P0 doesn't work for me.
>
> Thanks!
>
> Re, Uros
>
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

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