Low Voltage problem on Pin4

So i have created a shield that uses pin 4 and discovered a problem.

int outRam = 4;

void setup() {
  
   pinMode(outRam, OUTPUT); // Fire Ram output
  }

void loop (){

          digitalWrite(outRam, HIGH);
            delay(1000);
         digitalWrite(outRam, LOW);
         delay(1000);
 }

What i see when pin 4 goes high there is minimal voltage on it only like 1-2 volts. if i change the pin to 12 or any other pin there is no issue. I duplicated this on 2 seperate arduinos. and this is with no shield just measuring the the voltage on the pin.

On pin 12 i obviously see it go to 5v.

Thanks for the help.

I just tried your sketch and it produces 5V on D4 as expected. What types of Arduinos are you using?

decimilia...

i tried it on mind and another guys at the user group i was at today...

we also added pins 3 6 7 all of them produced 5v as expected.

"i tried it on mind and another guys at the user group i was at today..."

Bizzare, there has to be more to it then you have told us so far. :wink:

Lefty

there really isnt. I was using a shield. and part of it wasnt working.

After tracing everything out i detected that pin4 was going high but just barely. So i simplified the code down to the bare minimum and posted it here.

I then uploaded it to someone elses board and found the same thing.

They then expanded the program to try out 3-4 interfaces and saw the same thing.

We checked it with a meter, any pin but 4 would go high for a second and read 5v.

pin 4 would go high and read about 1.5. ALso wanted to note that all testing was done on a bare arduino no shield attached.

Again most bizarre. I just now of course loaded your sketch into my serial clone arduino (with the same shield connector layout) and of course I get 0v for a sec and 4.98v for a sec.

Another poster here stated they also saw no problem when trying your code. So we know the code is good and at least two of us can't duplicate your symptom.

So I guess your next step, if you have a steady hand is try and measure the output right at the 168 chip, which is pin 6 (TO) PD4 at it's socket location. You will need a sharp point on your meter lead. If it's good there then you may have have a high resistance solder joint or intermittent broken trace at the shield connector pin 4, or just making bad contact to the pin4 socket hole.

If it still measures bad right at the chip's pin then the next test is tricky but required. Power off the board and pull the 168 out of it's socket, then gently bend it's pin 6 straight out. Reinsert the chip, re-power the board and measure it's pin six again. If it's still bad then the 168 chip's pin busted, however if it then reads good then you have some kind of partial short circuit on the boards tracing or the pin 4 connector, causing excessive current to flow forcing the pin's output voltage to lower.

PS: The most bizarre part is you finding a friends board doing the same thing. However we can only troubleshoot one board at a time. Is it possible a shield is warped or misaligned somehow and is damaging the inside of the pin4 socket on the Arduinos? Just a WAG. I guess it's also possible that when you added the shield board some component or wiring error on the sheild caused too much current to be drawn from pin4, damaging it. Did your friends Arduino have your shield plugged into it at any prior time?

Good luck and left us know what you find.

Lefty

i'm "the other guy" who can confirm what soco is claiming... he first showed us that pin 4 was registering far below 5V, then reduced that sketch to a bare minimum, but the results were the same... we used my board and received the same results... i even loaded the example "Blink" sketch, changed to pin 4 and the same result - far below 5V. we checked other pins using the blink sketch and the results were the same between the two boards, which are both diecimilias, by the way..

we never plugged in the shield to my board..

something we didn't try was using another meter, but i doubt that would yield a different result, i'm just throwing differences out there.

my tests were run using USB power, while soco's may have been on another power supply... though, i can't recall if it was the board or the shield using it's own power source...

if i find time this evening, i'll check again using my own meter and board again... it's really odd indeed..

my first thought was that some register in the ATMEL needs to be set, but my knowledge is fairly limited when it comes to the AVR, i just use arduino...

isaac

All I can suggest is doing the electrical tests I gave prior and getting back to us with the results.

Lefty

a silly question - is it possible to read the current mode of pins from the ATMEL? i know we can set each, but not sure about reading FROM the chip.

in addition, we're both on version 12, i'm on vista, but not sure what OS soco is running

isaac

What were you originally connecting to the pin? It's possible your project fried the pin on both Arduinos.

When we setup Idovers board all we did was load the sketch and read pin 4. he was never attached to my project board.

I jumpered pin4 to pin6 and used pin6 in the sketch and all is well.

I have since put my shield back on and everything is now good to go. I just cant use pin 4.

btw i am on Vista as well.

So have you done the test that retrolefty suggested?

That would tell you if you have any hardware problems.