Burning Optiboot / DualOptiboot bootloader [solved]

Started by lilpint97, January 27, 2014, 01:04:27 PM

Uncle Buzz

Hi !
The pullup resistor (10k) on D10 should be at 3.6V maximum (maximum voltage for RFM69) or might be on VCC from the programmer (5V) and the 10k will protect the RFM69 ?
Thank you.

Felix


Uncle Buzz

D10 is only used by the radio, so no need to pullup D10 if there is the flash chip but no radio ?
With flash and radio, should we also use something like a level shifter on SPI signals from programmer ?

Felix

D10 needs to be pulled up. Thats the radio CS. The FLASH CS (D8 on Moteino) does not need it.
The programmer does NOT power your project, a common misconception. The programmer only senses the project VCC. So no level shifting required. Just power the Moteino or MCU as you normally would while you program it.

Uncle Buzz

Ok, so if I understand how it works, the programmer pull down voltages set by the atmega like on I2C , so no needs to protect SCK MISO and MOSI from 5V ?
the pulup resistor on D10 avoids the radio to also pull down SPI bus trying to communicate in same time than programmer.
Why the flash doesn't act like radio ? Maybe I misunderstood something...

Felix

Quote from: Uncle Buzz on April 05, 2018, 07:58:46 AM
Ok, so if I understand how it works, the programmer pull down voltages set by the atmega like on I2C , so no needs to protect SCK MISO and MOSI from 5V ?
the pulup resistor on D10 avoids the radio to also pull down SPI bus trying to communicate in same time than programmer.
The programmer reads the VCC of the board and uses that to assert ISP/programming port. Makes a lot of sense. The programmer NEVER powers your project, that would be a very bad idea. What if it's a power plant running on an AVR MCU, would it make sense for the programmer to supply 3275kW  while programming? - No.

Quote from: Uncle Buzz on April 05, 2018, 07:58:46 AM
Why the flash doesn't act like radio ? Maybe I misunderstood something...
It's more like the radio misbehaves. The FLASH is quiet when its CS is floating, the radio is not.

Uncle Buzz

Vcc pin on programmer is not power supply but a sensing to set voltage on communication pin ?
So Vcc from programmer should be connected to 3V3 output of moteino while moteino is powered otherway ?

Felix

Quote from: Uncle Buzz on April 05, 2018, 12:50:34 PM
Vcc pin on programmer is not power supply but a sensing to set voltage on communication pin ?
So Vcc from programmer should be connected to 3V3 output of moteino while moteino is powered otherway ?
Yes.
Yes.

perky

In reality the VCC input to the programmer powers a buffer inside the programmer, so the outputs of the buffer like MOSI, SCK and CS# are driven to that voltage.

Mark.

overlord

Because my AVR MKII ISP clone was fried, I tried to use an Arduino UNO as ISP with avrdude to burn the 8MHz Bootloader on some original and homegrown R4 Moteinos.
https://www.arduino.cc/en/tutorial/arduinoISP
To power the R4 Board from the Uno I used the 3,3 V not the 5 V output.
D10 was pulled up with 10K against Vcc. I did not set lockbits.

avrdude -P /dev/ttyACM0 -b 19200 -c avrisp -p m328p -U efuse:w:0xFD:m -U hfuse:w:0xDC:m -U lfuse:w:0xDE:m
avrdude -P /dev/ttyACM0 -b 19200 -c avrisp -p m328p -U efuse:w:0xFD:m -U hfuse:w:0xDC:m -U lfuse:w:0xDE:m -e -U flash:w:DualOptiboot_V5.0_atmega328_BlinkD9.hex

The avdude process in my case is only reliable with USB Ports under Windows. I used avrdude which came with Arduino Toools.
With Linux, Raspi and MacOSX I got verification errors while fuse burning and flashing the Bootloader.
Anyway I will again buy an ISP and use Atmel Studio for the Bootloader only, depending on only one Machine/USB combination is not so good.
Once the bootloader is burnt I use VS Code/Platform IO under Linux/MacOS which works well.

René


overlord

#55
I have a new AVR ISP II Clone which is able to power the Board with 3,3 Volt, even if the RFM69 receiver is already soldered, during Bootloader Burning.
It does also level shifting to 3,3V for the Logic Signals and has adaptive bit rate adoption. I will now convert all my Moteinos into 3V versions, once the last 9 Volt Batteries are weared out.
https://www.diamex.de/dxshop/mediafiles//Sonstiges/ENG%20erfos-avr-isp2.pdf
This works out of the box with avrdude on Linux (8MHz variant fuses and bootloader example command lines ).
avrdude -P /dev/ttyACM0 -c avrisp2 -p m328p -U efuse:w:0xFE:m -U hfuse:w:0xDC:m -U lfuse:w:0xD2:m
avrdude -P /dev/ttyACM0 -c avrisp2 -p m328p -v -e -U flash:w:Dualoptiboot_v5.0_atmega328_8mhz_57600baud_BlinkD9.hex