hi
i'm testing my first project using all in 1 development board eedt6.00 Keiluvision4 and flashmagic. i use the sample source code:
#include <lpc21xx.h> void wait (void) { /* wait function */ long d; for (d = 0; d < 10000; d++); /* only to delay for LED flashes */ } int main (void) { unsigned int i; /* LED var */ IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */ while (1) { /* Loop forever */ for (i = 1<<16; i < 1<<23; i <<= 1) { /* Blink LED 0,1,2,3,4,5,6 */ IOSET1 = i; /* Turn on LED */ wait (); /* call wait function */ IOCLR1 = i; /* Turn off LED */ } for (i = 1<<23; i > 1<<16; i >>=1 ) { /* Blink LED 7,6,5,4,3,2,1 */ IOSET1 = i; /* Turn on LED */ wait (); /* call wait function */ IOCLR1 = i; /* Turn off LED */ } } }
debugging running with succes i see in the pheripals block 1 the io ports being swithched on and off then i'm creating the hex file i get 0 errors and 0 warnings in flashmagic i select the correct hex file and start the programming with verrification. no problems, green and red led blinking. after that flashmagic says finished. When connecting the 8 pins to the led's i get nothing. after messuring the io ports are 2.2 vdc stationairy. other io port for example port 1.31 reads 3.3 volt ???.
so program run correct in debugging mode, flashing seems all right, on the board led D1 is blinking D12 D16 D17 are lit.
thanks in advance Thomas Crow
Your code is very hard to read, since you forgot the "pre" tags (note about how to post source code directly above the message input box).
Are you sure that your delay function gives a reasonable delay, so the port pins isn't changing state too fast for you to see any blink, and too fast for the multimeter to see anything but an average value?
One way to test.
Do one set of code that only do IOSET1 and test running it. Do one set of code that only do IOCLR1 and test running it.
Without any blink code anymore, one app should result in the LEDs being all on, and one app should have them all off. If that works, then the goal must be to figure out if you have a decent delay between the on and off lines.
Note that software delays like you are using have big problems - it's up to the compiler and code generation to decide how long the delay takes. The compiler may even optimize away the delay loop if it hasn't any side effect. The processor have lots of hardware that may be used for measuring time.
Another thing - there is no need to create new threads just to repost the source code formatted. It's enough to just add one more post to the existing thread. What do you think happens when Google picks up the other thread? How will a reader then know that you have moved on to a new thread?
since you make the mistake of using a "hope it does it, though I wrote it in C" delay I guess that "messuring the io ports are 2.2 vdc stationairy" represent a "DC reading of AC". What does a scope show?
I do believe that you are blinking waaaaaaay too fast (which makes it invisible), use a timer and set it for, say 200ms blink freq.
Erik
Thank you guys
i tested this:
both tests where resulting in a vdc 2.1 at the io ports
i think it's a hardware faillure
thanks for the tips.
Are you using the correct pins - if they are tristated, then you can use a 10k resistor connected to +3V3 or GND and force the signal to significantly change voltage (in one direction, the LED will put up a bit of a fight, stopping you from reaching the rail).
development board eedt6.00 I have seen many posts mentioning a board, rather than a chip.
since I/O is different from chip to chip and most of us do not have knowledge of all devboards on the market, please always state the chip.
that would be the nxp lpc2138