toggling GPIO on LPC2148

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
sagar
Posts: 4
Joined: Mon Feb 20, 2012 7:12 pm

toggling GPIO on LPC2148

Post by sagar »

Hi,
I intend to use P0.7 of LPC2148 as chip select for one of my pheripherals on board hence I am trying to toggle GPIO P0.7 but it stays latched to high state. I have tried to use following APIs to program the pad mode but still it does not help.

palSetPadMode(IOPORT1,7,PAL_MODE_OUTPUT_PUSHPULL);

I can change values of other GPIOs (P1.16~1.23 and P29) on board using palSetPort and palClearPort APIs but P0.7 is exception to this. I am using default board config for Olimex LPC2148 board and have not changed it much. Am I missing something?

Regards,
Sagar
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: toggling GPIO on LPC2148

Post by Giovanni »

Hi Sagar,

That pin is programmed as SSEL0 in board.h, the function palSetPadMode() is not able to change its mode to GPIO. If you need to use that pin as GPIO then modify board.h (see #define VAL_PINSEL0).

Usually it is a good idea to "clone" the board directory and make your custom settings in the clone then you can edit the Makefile to point to the clone.

Giovanni
sagar
Posts: 4
Joined: Mon Feb 20, 2012 7:12 pm

Re: toggling GPIO on LPC2148

Post by sagar »

Thanks Giovanni. It works for me. :)
Post Reply