jayanthyk192
Full Member level 3
- Joined
- Sep 17, 2010
- Messages
- 179
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,298
- Activity points
- 2,580
#include <LPC210x.H> /* LPC21xx definitions */
void delay (void)
{ /* wait function */
int d;
for (d = 0; d < 10000; d++); /* only to delay for LED flashes */
}
int main (void)
{
IODIR = (1<<19);
while (1)
{
IOSET=(1<<19);
delay(); delay();delay();delay();delay();
IOCLR=(1<<19);
delay(); delay();delay();delay();delay();
}
}
I'm sorry I forgot to mention it. There is a 220ohms resistor in between the led and supply pin.Driving an LED directly without a current limiting resistor is typically not advisable.
However, I believe the LPC2106, as well as the entire LPC21xx family of devices, is only capable of sinking or sourcing 4mA per GPIO pin.
Attempting to drive most standard leaded LEDs with such a low current may not be successful.
A more viable technique would be to drive the LED utilizing a transistor with a proper current limiting resistor in series.
Www
I would also suggest studying both the datasheet and user manual of the device, not knowing the basic limits of the device can result in a damaged microcontroller.
BigDog
I'm sorry I forgot to mention it. There is a 220ohms resistor in between the led and supply pin.
I removed the led and used a multimeter to test the level and it remained in 0v.Well that is good to know, you had me worried.
Try drive the LED with a transistor or find a low current LED 2mA/5mA and if you are still having problems post them.
BigDog
I already tried it, nothing happened 0v.
I'm using kell with their startup file, unmodified.
Well that is not good news. Did you set the pin high within a while(1) loop?
Is this a commercial development board or a board of your own design?
BigDog
I made the board myself. Do you need details?
Yes, can you post a schematic?
BigDog
No, I was running it on a battery and so i didn't add them. Should I?Any decouple/bypass capacitors (100nF), from all Vdd to Vss?
to pin5Vdd 1.8v is connect to which pin, it is omitted in your reply?
In that case the FLASH Magic should give me an error with autobaud. It doesn't. And the datasheet said 38pF so i used it.Also the capacitors on your crystal should be more in the 15-22pF range, although that should prevent oscillation.
Yes I send the P0.14 to VCC and reset.After flashing the device are you resetting it to allow it to begin execution?
No, I was running it on a battery and so i didn't add them. Should I?
In that case the FLASH Magic should give me an error with autobaud. It doesn't. And the datasheet said 38pF so i used it.
EDIT: I found a new thing. When I held the meter with the probes touching the lines, i got some .5V, But then i held the probe with my finger touching it and I got 3.3V. Then I set it to zero and still got 3.3V with finger touching and .5V without it. So, is the problem with ground or any other?
I already tried it, nothing happened 0v. I'm using kell with their startup file, unmodified.
IODIR = 0xffffffff;
IOPIN = 0xffffffff;
/* FAST General Purpose Input/Output (FGPIO) */
#define SCS (*((volatile unsigned long *) 0xE01FC1A0))
#define FIOPIN (*((volatile unsigned long *) 0x3FFFC014))
#define FIOSET (*((volatile unsigned long *) 0x3FFFC018))
#define FIODIR (*((volatile unsigned long *) 0x3FFFC000))
#define FIOCLR (*((volatile unsigned long *) 0x3FFFC01C))
SCS= 0; // set to slow IO just to be sure
IODIR = 0xffffffff;
IOPIN = 0xffffffff;
SCS = 1; // set to fast IO
FIODIR = 0xffffffff;
FIOPIN = 0xffffffff;
Code:IODIR = 0xffffffff; IOPIN = 0xffffffff;
Do you have a legacy LPC2016 (LPC2016/00) or the enhanced version LPC2106/01?
I tried that but again nothing. As I saw in the datasheet, IOPIN reads the pin value or the port bit register according to IODIR. So, I tried IOSET but again nothing.
The one I have is LPC2106B, not the one you mentioned.
I think so, because the bootloader is running.Is your crystal working?
In FLash Magic it says "finished" after a series of write and verify cyclesIOPIN gives direct access to the IO register, you can either read it to get the state of a pin or write it to set the state of a pin.
So no pin is responsive to your program, are you sure that you do actually write the program to the device , do you get a confirmation?
Can you please zip the project folder of uvision, I wonder if the cause of the problem is there (maybe a wrong memory space )
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?