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

ARM7 Begineer

Hello All, I just started to lean the basics of ARM. I tried with the following program with LPC2148 and it works perfectly.

/*********************************************************
#include <LPC214x.H>
void delay(void);

int main(void)
{ IODIR0=0xFFFFFFFF;

while(1) {

IOSET0|=0xFFFFFFFF; delay(); IOCLR0=0xFFFFFFFF; delay(); delay();

}
}

void delay(void)
{ int z,c; c=0; for(z=0; z<4000000; z++) { c++; }
}

#include <LPC214x.H>
void delay(void);

int main(void)
{ IODIR0=0xFFFFFFFF;

while(1) {

IOSET0=0xFFFFFFFF; delay(); IOCLR0=0xFFFFFFFF; delay();

}
}

void delay(void)
{ int z,c; c=0; for(z=0; z<4000000; z++) { c++; }
}

/**********************************************

But I do have a problem with it. When I try to turn ON/OFF a single PIN for ex: P0.3 using the following statements, it never works. Please help me to get solved. What should I do more to make it work?

IODIR0|=(1<<3);

while(1) {

IOSET0|=(1<<3); delay(); IOCLR0|=(1<<3); delay();

}

Thanks

Parents
  • So you looked at page 80 of the manual.

    But was page 80 the only page showing up when doing a search for P0.3?

    Page 80 of your manual (if I guess what manual you might have) seems to be chapter 8: LPC214x GPIO.

    What I did write was "Did you look at the chapter about pin configuration?"

    Chapter 5 is named "LPC214x Pin configuration"

    Notice some similarity between chapter name, and my sentence from my previous post? Can you possibly guess why?

    Let's look at chapter 5 (unless you did a search on P0.3).
    It has the text "I2C0 data input/output. Open drain output (for I2C compliance)"
    And it has a footnote [3] with the text "Open-drain 5 V tolerant digital I/O I2C-bus 400 kHz specification compatible pad. It requires external pull-up to provide an output
    functionality."

    The above information (without knowing anything about chapters) was possible to find by searching for P0.3 in acrobat reader and just step through all references to this specific pin.

    Even a beginner in low-level embedded programming would reasonably be expected to know the advantage of search tools, when something doesn't work as expected. Even if it is way better to go the professional route: to read through the data sheets/user manuals up-front. I.e. before getting stuck.

Reply
  • So you looked at page 80 of the manual.

    But was page 80 the only page showing up when doing a search for P0.3?

    Page 80 of your manual (if I guess what manual you might have) seems to be chapter 8: LPC214x GPIO.

    What I did write was "Did you look at the chapter about pin configuration?"

    Chapter 5 is named "LPC214x Pin configuration"

    Notice some similarity between chapter name, and my sentence from my previous post? Can you possibly guess why?

    Let's look at chapter 5 (unless you did a search on P0.3).
    It has the text "I2C0 data input/output. Open drain output (for I2C compliance)"
    And it has a footnote [3] with the text "Open-drain 5 V tolerant digital I/O I2C-bus 400 kHz specification compatible pad. It requires external pull-up to provide an output
    functionality."

    The above information (without knowing anything about chapters) was possible to find by searching for P0.3 in acrobat reader and just step through all references to this specific pin.

    Even a beginner in low-level embedded programming would reasonably be expected to know the advantage of search tools, when something doesn't work as expected. Even if it is way better to go the professional route: to read through the data sheets/user manuals up-front. I.e. before getting stuck.

Children
No data