EmbeddedRelated.com
Forums

Simple GPIO not working completely?!

Started by active_si March 24, 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:

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

An Engineer's Guide to the LPC2100 Series

Hi Uros,
--- In l..., "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
Hi,

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
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