Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If anyone wants to build and compile V3.0 with the ATmega4809 chip using an FT232R Breakout #57

Open
gotnull opened this issue Aug 10, 2023 · 1 comment

Comments

@gotnull
Copy link

gotnull commented Aug 10, 2023

Working with an ATmega4809

https://github.com/gotnull/Solder-Reflow-Plate/blob/main/Board%20Versions/70mm%20by%2050mm%20Ver3.0%20ATmega4809/Software/SW1.0_HW3.0_70by50mm.ino

To Prepare

  1. Include MiniCoreX in additional boards via the Arduino IDE Boards Manager: https://mcudude.github.io/MegaCoreX/package_MCUdude_MegaCoreX_index.json
  2. Install Bounce2, Adafruit_GFX and Adafruit_SSD1306 libraries (Tools->Manage Libraries)

To Program

  1. Select the following settings under (Tools)

Screenshot 2023-08-11 at 10 29 06 am

Board > MegaCoreX > ATmega4809
Clock > Internal 16MHz
BOD > BOD 2.6V
EEPROM > EEPROM retained
Pinout > 48 pin standard
Reset pin > Reset
Compiler LTO > LTO Disabled
Bootloader > No bootloader

Compile to ATmega4809

I followed this guide here: https://swharden.com/blog/2022-12-09-avr-programming/

Specifically this setup:

updi-ftdi-serial-programmer

unnamed (2)

Connect the programmer as shown with the RX pin directly to the UPDI pin of the microcontroller and the resistor between the RX and TX pins. IMPORTANT: The Reflow Plate must be powered externally via 12V with a minimum of 5A during this process.

I used a 10KΩ 0.5W resistor instead. This is even closer to the recommended value. 10KΩ is a common pull-up resistor value used in many electronics applications. It should work well for the UPDI interface.

Ensure a modern version of Python is installed on your system

pip install pymcuprog

Use the device manager to identify the name of the COM port representing your programmer. In my case it was /dev/tty/usb.serial-AH00XXXX on MacOS.

I then interacted with the microcontroller by running pymcuprog from a terminal. This command returns the Device ID (1E9651 for my ATmega4809) indicating the UPDI connection is working successfully.

pymcuprog ping -d atmega4809 -t uart -u /dev/tty.usbserial-AH00XXXX

Connecting to SerialUPDI
Pinging device...
Ping response: 1E9651
Done.

I used Arduino IDE to compile my C code and generate the hex file (turn on verbose output during compilation to know the location of your .ino.hex file). Now you can use pymcuprog to load the hex file onto the chip. It’s slower to program and inconvenient to drop to a terminal whenever you want to program the chip, but it works.

pymcuprog write -f SW1.0_HW3.0_70by50mm.ino.hex -d atmega4809 -t uart -u /dev/tty.usbserial-AH00XXXX --erase

Connecting to SerialUPDI
Pinging device...
Ping response: 1E9651
Erasing device before writing from hex file...
Writing from hex file...
Writing flash...
Done.

@gotnull gotnull changed the title If anyone wants to build and compile with the atmega4809 chip. If anyone wants to build and compile V3.0 with the ATmega4809 chip. Aug 11, 2023
@gotnull gotnull changed the title If anyone wants to build and compile V3.0 with the ATmega4809 chip. If anyone wants to build and compile V3.0 with the ATmega4809 chip using an FT232R Aug 11, 2023
@gotnull gotnull changed the title If anyone wants to build and compile V3.0 with the ATmega4809 chip using an FT232R If anyone wants to build and compile V3.0 with the ATmega4809 chip using an FT232R Breakout Aug 11, 2023
@RapierXbox
Copy link

Is the script the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants