Pages: 1 [2]   Go Down
Author Topic: Pwm output is high on bootup?  (Read 3284 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whoops sorry about that,
Version 0021

Logged

0
Offline Offline
Shannon Member
****
Karma: 199
Posts: 11639
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

[ I won't respond to messages, use the forum please ]

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33288
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-wink
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12739
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
I tried this code on version 0022:

Code:
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.



« Last Edit: February 18, 2011, 04:19:29 am by nali2001 » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12739
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
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

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12739
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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!
Logged

Pages: 1 [2]   Go Up
Jump to: