New answers tagged

2

By defining your own main() you are circumventing the Arduino startup procedures. Normally with Arduino code main() first runs an init() function before setup() and (repeatedly) loop(). This init() function will configure, amongst other things, the timer for millis() and delay(). This is the normal main() for a basic AVR-based board: int main(void) { ...


2

So does "Update of OCR1x at" mean that only when when the pulse wave form has reached the value of BOTTOM (or the end of a period), that's when the value of OCR1x will be passed on to the OCx pins... Yes, that's what it means. To prevent glitches in the PWM output, you frequently do NOT want the PWM waveform to change immediately the instant you ...


0

Maybe you could jump to right after the line if (!(ch & _BV(EXTRF))) appStart(); Here is an excerpt of the disassembly: if (!(ch & _BV(EXTRF))) appStart(); 7e06: 81 ff sbrs r24, 1 7e08: f0 d0 rcall .+480 ; 0x7fea <appStart> #if LED_START_FLASHES > 0 // Set up Timer 1 for timeout counter ...


1

The source of Optiboot on Uno is here. I would prefer a simple watchdog reset with wdt_enable(WDTO_15MS); while (true); But I am not sure now if it runs sketch upload detection in bootloader. For direct jump to Optiboot on Uno (one flash page) this should work typedef void (*bootloader_jump_t)(); const bootloader_jump_t bootloader_jump = (...


3

The WS2812B chips are very sensitive to timing. They rely on pulses being just the right length for things to work. It is common if the timing is off that you just end up with white. Since you have a blank chip that you have never put a bootloader on the fuses will be set wrongly for your configuration. By default a chip comes configured for the internal ...


0

How can I burn the bootloader onto ATmega328 (not ATmega328P)? As Juarj commented, For a variety of standalone AVR microcontrollers you can add new "cores" to the Arduino IDE using it's board manager. This provides the Arduino IDE with information about your specific chip and this means the IDE can instruct the avrdude program appropriately and ...


0

This can also be a power shortage as there will be a drop when the relays turn on, depending on you psu it might not respond quick enough, so you get a brown out. I added a bit 4700uF cap on the psu power line to the arduino.


Top 50 recent answers are included