help with LPC23xx

Hi guys,

I’m a newbie working on a Olimex LPC2378-STK board, I’m trying to get the LCD work, I had problem controlling the LCD_CS line which is P1.21.

I have set

PINSEL3=0x0003C300; // P1.21 is GPIO

FIO1MASK=0x0;

FIO1DIR=1<<21; // P1.21 dir=output

but neither FIO1SET or FIO1CLR works because I always get an 0 in FIO1PIN, what could be the problem?

By the way, I saw the demo code in IAR uses SSP0, what is the difference of SSP0 and SPI0?

Thank you

Have you checked to make sure that the FIO controller is enabled?

By default, the GPIO regs are used [at least on the smaller devices].

Cheers,

–David Carne

Thanks! That’s the point!

I have to set Bit 0 in SCS:

0 GPIOM GPIO access mode selection. R/W 0

0 GPIO ports 0 and 1 are accessed via APB addresses in a fashion

compatible with previous LPC2000 devices.

1 High speed GPIO is enabled on ports 0 and 1, accessed via addresses in

the on-chip memory range. This mode includes the port masking feature

described in the GPIO chapter.

before using the FIO feature

Thank you!!