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
toggling GPIO on LPC2148
Moderators: RoccoMarco, lbednarz, tfAteba
- 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
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
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