Go Down

Topic: Pwm output is high on bootup? (Read 4379 times) previous topic - next topic

nali2001

Whoops sorry about that,
Version 0021


MarkT

This is probably an Uno/Optiboot 'feature'  - optiboot does less initialization, probably not reseting pins to input mode.  Power-up reset does this but subsequent resets don't?
[ I won't respond to messages, use the forum please ]

Grumpy_Mike

Quote
probably not reseting pins to input mode.

No that happens automatically as a result of the reset pin being hit. It is a hardware thing.

retrolefty


Quote
probably not reseting pins to input mode.

No that happens automatically as a result of the reset pin being hit. It is a hardware thing.


I'm not so sure, the Uno/Optiboot 'features' and the new 8u2 usb converter chip sure made for a rather rocky introduction to the latest board offerings from Arduino, with more bugs then any other new board offerings I can recall. And also requiring two IDE releases in very short order.

In hind site they would probably been better off just introducing the 8u2 feature and put off changing from their more proven bootloader code. That or they need a better beta process before rushing new boards to market.

My money 2 cents is that this symptom uncovered in this posting will be at least related to the new bootloader if not directly caused by it. No proof, just shooting from the hip.  ;)

Coding Badly

Whoops sorry about that,


No problem.

Quote
Version 0021


I cannot find anything in 0021 that would cause this sort of problem.  I cannot find anything going from 0021 to 0022 that would effect PWM.

But, just in case I missed something, I suggest upgrading to 0022 and rerunning the tests.

nali2001

#20
Feb 18, 2011, 10:17 am Last Edit: Feb 18, 2011, 10:19 am by nali2001 Reason: 1
Hi all,
I tried this code on version 0022:

Code: [Select]
int Pwm_output_pin_10 = 10;

void setup()
{
 pinMode(Pwm_output_pin_10, OUTPUT);
 analogWrite(Pwm_output_pin_10, 128);
}

void loop()
{
}


Same result. Output still goes high for a short moment. Just to check I also tried it all on an other Arduino board and the problem is still there.

I have two new video's.
You see it with a led instead of the scope.
I plug in the cable and you see the process. It goes high for a little while, then nothing and after that high again and it's ready for use. I also later on press reset and you see it now does 'reboot' nicely without the 'going high' problem.

First video:
http://home.planet.nl/~sintt000/Arduino3.wmv

Second video:
Here you see the boot process when powered from a battery.
This works fast and without the problem.

http://home.planet.nl/~sintt000/Arduino4.wmv

Thanks.




Coding Badly

The processor that's on that board ... where did you get it?  Is it the processor that came with the board?

Is that the same board you were using earlier with the oscilloscope testing?

Just to confirm ... the LED is on pin 10?

Do you have an ICSP?  Another Arduino?

nali2001

I tried this code:
So no Arduino native PWM but a digitalWrite and Delay combo on pin 8.
Problem is the same.

Code: [Select]
int LedTest1 = 8;

void setup() {
  pinMode (LedTest1, OUTPUT);
}

void loop() {
  digitalWrite(LedTest1, HIGH);
  delay(25);
  digitalWrite(LedTest1, LOW);
  delay(25);
}


Please see the video:
http://home.planet.nl/~sintt000/Arduino5.wmv


nali2001

Hi,
Yes the board came ready to use so including the chip.
I'm not really sure where we got them, probably a local Dutch electronics store. My boss bought them (we have 2 boards)

Yes the same board as used in the scope video.

Yes pwm pin 10.

I have two boards and both behave the same.
I have no ICSP

Thanks!


The processor that's on that board ... where did you get it?  Is it the processor that came with the board?

Is that the same board you were using earlier with the oscilloscope testing?

Just to confirm ... the LED is on pin 10?

Do you have an ICSP?  Another Arduino?


Coding Badly

Using the "Arduino Duemilanove or Nano w/ ATmega328" board option (ATmegaBOOT_168_atmega328.hex bootloader) I cannot reproduce the problem.  Everything works as expected.

I have not been able to test with the "Arduino Uno" (optiboot_atmega328.hex bootloader)...

Code: [Select]
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.


Would someone with an Uno (or someone who can get Optiboot working) mind trying to reproduce this problem.  All that's needed are a few LEDs + resistors and one of the Sketches above.

nali2001

Thanks for trying,
Odd that you don't see this issue, I tried two broads and the problem is the same.
That is, only when powered from usb cable, powered from battery solves the problem.

Looks like the usb communication interrupts the operation of the board when cable is just plugged in.

So if anyone wants to verify this problem, this is what you need:
470ohm resistor and a led.


And this code:

Code: [Select]
int Pwm_output_pin_10 = 10;

void setup()
{
 pinMode(Pwm_output_pin_10, OUTPUT);
 analogWrite(Pwm_output_pin_10, 128);
}

void loop()
{
}


Power it from usb and see if the led goes on for a short moment, then off, and after a while on again.

Thanks!

Go Up