This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

simple GPIO Port example with MCB2300

Hi,

I'm using MCB2300 board in order to learn about ARM programming.
I used BLINKY example and it worked well.
Now, I want to set and clear another GPIO port, with the exception of the GPIOs used in BLINKY example, but I didn't get it. When I debug the program it seems it works but the board doesn't show the same result. All the GPIO ports show 2,5V.
I'm sending bellow the code I used.
Could anyone help me?

Thanks a lot.

Code:

#include <stdio.h>
#include <LPC23xx.H> /* LPC23xx definitions */

void PORTS_Init(void) { PINSEL0 = 0x00000000; FIO0DIR |= 0x00023C0; /* P0.6, P0.7, P0.8, P0.9 and P0.13 as outputs*/ FIO0MASK = 0x00000000; }

int main (void) {

PORTS_Init(); /* inicializa as portas */

FIO0SET = 0x00000100; /* set P0.8 */ FIO0SET = 0x00000200; /* set P0.9 */ FIO0SET = 0x00002000; /* set P0.13 */

while (1) { }

}

  • Why didn't you post your source code formatted as code? It is very hard to read when you post is as inlined text.

    The informatin directly about the text input box does tell how to post source code.

    Your code is using the fast GPIO interface, but you don't seem to have turned on that interface.

    I can't see any:

        SCS |= GPIOM;                   // Want to use fast I/O
    


    anywhere in your code.

    The user manual for the processor tells you a lot of interesting information if you do read the chapter about the GPIO.