Electronics > Microcontrollers
AVR- Uploading New firmware on AVR 0 series through UART
sanka1p:
Hi All,
This is completely new topic for me, I am trying to upload firmware on my Atmega1608, through a UART - USB bridge chip. I have a made a block diagram and pasting it below for better understanding. I know, I would have to make a boot-loader first and flash that boot-loader into Atmega1608, but where should I get started for that. I have seen an application note from Microchip that gives info about UART boot-loader and they also gave a sample boot-loader. Would that be a good starting point? At the end I want to take a hex file generated by my IDE and upload that hex file through USB onto the MCU. One important point to note here is that CH9326 is a HID USB device chip.
sgnka:
--- Quote from: sanka1p on September 20, 2023, 02:55:34 pm ---I know, I would have to make a boot-loader first and flash that boot-loader into Atmega1608
--- End quote ---
You don't have to; the 0-series chips can be programmed using a USB-USART bridge over their native UPDI protocol as well using pymcuprog. However, if you actually want to program it without using UPDI or envision having to program it in the field without access to the UPDI pin, then yes, a bootloader is required.
--- Quote from: sanka1p on September 20, 2023, 02:55:34 pm ---Would that be a good starting point?
--- End quote ---
Yes, it works well and is simple to understand.
--- Quote from: sanka1p on September 20, 2023, 02:55:34 pm ---One important point to note here is that CH9326 is a HID USB device chip.
--- End quote ---
However, the example won't work out of the box with CH9326 (and neither will pymcuprog), since the python script expects a serial device connected to the PC and talks to it using pyserial, while your chip presents a HID interface on the PC. You can modify the script to use the hid library or use a CH340/CP2102/FT232 etc. serial-USB converter. I suggest doing the latter.
bingo600:
Isn't that mcu a 2K flash device ?
How much space will a HiD BL take ??
Psi:
Atmega1608 is 16KB
up8051:
It can be very small.
I have my own UART bootloader for ATTiny Series-0.
- simple version 256 bytes
- version with encrypion (AES128) 768 bytes.
Navigation
[0] Message Index
[#] Next page
Go to full version