confusion pin 2 & 3

hi am completely new to arduino & was trying to do the blinking delay led ..it worked perfectly on ports PWM 4-13.But when i coded it for port PWM 2 it worked but it was also sending the same signal on port PWM 3 & the same happened when configured for port PWM 2. i'm using an atmega 1280. does anybody know y ?? :-/

does anybody know y ??

Without seeing your code? No, I think it unlikely.

int del=100;

void setup() {

pinMode(2,OUTPUT);

}

void loop() {

digitalWrite(2,HIGH); delay (del); digitalWrite(2,LOW); delay (del);

}

if i connect a led to pin 3 it also starts flashing :-(

Looks like you have wired it up wrong or there is a short circuit on the output pins. If you use pin 3 in the sketch does an LED on pin2 flash. If so it is defiantly a short.

You fooled us all with talk of PWM Pin2 - PWM has noting to do with this.

yes if i use pin 3 .. pin 2 also starts to blink. Any solution for a short circuit ??

It's your wiring, so it's detective work now. Trace it through and see if there's anything bridging across from one output connection to the other output connection. Pointing at the lines with a pen or something pointy, and following the route along, is a way that I use a lot. Unless you've actually done something like connect the led across pin 2 and 3!

no it's not the wiring it's in the board itself pin 2 & 3 are sending the same signals ...i don't know how it happened because i bought a ready made board

Any solution for a short circuit ??

Scalpel, file, soldering iRon (tm Apple), Dremel…

i don’t know how it happened

A manufacturing fault either in the placement and soldering of the chip or a problem with the PCB traces. Either way you need to do some cutting. Look with a strong magnifier and see if you can find it first. If is is a solder bridge between the pins a quick application of the iRon ( :wink: ) will do it.

PCB trace bridging at the etching stage is a bit unlikely - I'd expect it to show up on more than one unit in or across the batches, and it'd be likely to have come to attention by now. Solder bridging is not unlikely, though — this can easily occur on an individual unit level. Look for wisps of solder, or just plain globs of solder across pins.

Have you got a decent digital camera that can do close-ups and have you got a decent lighting setup you can throw onto the subject (ie, a little desktop halogen, if you position it to manage to avoid glare hotspots in the picture). Photograph it both sides, and in situ with your connections and wiring. Post the pics or a link to the pics.

I'd expect it to show up on more than one unit in or across the batches,

No I have seen boards with a single PCB track error in a batch of several thousand. It is generally caused by scratches caused by poor handling between mask printing and etching.

Oh that's true, too. One of my first sort of proper jobs just after leaving art college was in a nearby place that made PCBs. A loose hair will do it, too (although if it gets on the silk screen, it does it to all of them!).

thxs guys for ur tips .........actually there was a short circuit between the pins of the atmega chip itself..... they wrongly did the the soldering the 2 pins were connected ............................. ;D