Is there a way to stop d13 from switching on and off 3 or 4 times when the chip gets a reset.
Im asking this because i have a relay attached to d13 and on a reset it clicks the relay over when it resets.
Thanks.
Is there a way to stop d13 from switching on and off 3 or 4 times when the chip gets a reset.
Im asking this because i have a relay attached to d13 and on a reset it clicks the relay over when it resets.
Thanks.
The only way you'll do that is to burn a custom bootloader to the chip that doesn't flash D13.
Will look into a bootloader, or re route the pcb so that the relay goes to a different pin.
Was hoping there would be a simple bit of code to stop it.
Thanks
The code is simple, compiling and flashing a variant bootloader is less simple...
[actually there are ways to burn a sketch without the bootloader, using ArduinoISP, I believe - someone
actually done this?]
I have altered the circuit so the relay is not on d13, thanks anyway.
You could change the fuses so it doesn't run the bootloader. Might make uploading the next sketch harder though.
I've been looking into this to.
Not sure what bootloader you are using, but for the optiboot i think it should be possible by defining "LED_START_FLASHES" 0 in the makefile.
In the optiboot.c you'll find this:
#ifndef LED_START_FLASHES
#define LED_START_FLASHES 0
#endif
#if LED_START_FLASHES > 0
/* Flash onboard LED to signal entering of bootloader */
flash_led(LED_START_FLASHES * 2);
#endif
#if LED_START_FLASHES > 0
void flash_led(uint8_t count) {
do {
TCNT1 = -(F_CPU/(1024*16));
TIFR1 = _BV(TOV1);
while(!(TIFR1 & _BV(TOV1)));
#ifdef __AVR_ATmega8__
LED_PORT ^= _BV(LED);
#else
LED_PIN |= _BV(LED);
#endif
watchdogReset();
} while (--count);
}
#endif