Pages: [1]   Go Down
Author Topic: arduino MEGA reset sequence  (Read 496 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i have a project where I have leds connected to PWM pins 2-13  I notice on a RESET that the led connected to PWM 13 flashes at full brightness whenever a reset occurs.  Is there a way to disable this function??  This occurs on the MEGA board
« Last Edit: December 15, 2011, 11:36:36 am by wzakaras » Logged

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

Quote
Is there a way to disable this function??  This occurs on the MEGA board

That is a result of the bootloader program on the mega becoming active upon a reset. When the bootloader detects that there is not a new sketch upload being attempted it 'times out' and then jumps to any sketch that was previously uploaded to the chip. All arduino boards that use a bootloader use pin 13 as a signaling device. So if your application cannot have that behaviour you will have to erase the bootloader and load the sketch via ISP with a hardware programmer.

Lefty

Logged

0
Offline Offline
Shannon Member
****
Karma: 221
Posts: 12710
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or use a different pin, or recompile a version of the bootloader that doesn't toggle pin13...
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you,  recompile/reload the bootloader   is more then i want to tackle.  another pin is not an option.  i need 13  outputs.  after learning that analogwrite 0 & 1  (PWM 0 & 1) are not really available, as the are either on or off and can't be pulsed (Very misleading when the spec says 14 analog outputs, there are really only 12).  So I'll propose another solution and possibly you can offer your thoughts.

In the circuit Pin 13 is driving the input transistor of an open collector darlington array.  the output of the darlington sources 200ma of current to drive 2 ultrabright leds..  Simple enuff circuit   
when a reset occurs the ultrabright leds go full blast ruining the effect that I am building.

If I were to AND the output of Pin 13 and another Digital output (eg 24) would that solve my issue upon a reset?  Digital Pin 24 should be low upon a reset and after initialization I can set it HIGH via a  digitalwrite(24,HIGH)  thus enabling the normal operation of PWM 13

Does this sound like it would work?

Thanks for your input. 
Logged

0
Offline Offline
Shannon Member
****
Karma: 221
Posts: 12710
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With a pull-down resistor, as most pins are hi-Z (INPUT mode) on reset.
Logged

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

Pages: [1]   Go Up
Jump to: