Skip to content

Add Nano Every ATmega4809 register compatibility - #116

Open
ChristRm wants to merge 2 commits into
kalymos:masterfrom
ChristRm:fix/nano-every-atmega4809-support
Open

Add Nano Every ATmega4809 register compatibility#116
ChristRm wants to merge 2 commits into
kalymos:masterfrom
ChristRm:fix/nano-every-atmega4809-support

Conversation

@ChristRm

Copy link
Copy Markdown

Summary

This adds explicit support for Arduino Nano Every / ATmega4809 builds that use Arduino's 328 register emulation compatibility layer.

The existing ATmega4809 implementation uses native PORTx.DIRSET, PORTx.OUTCLR, and PORTx.IN register access. That works when compiling with Registers emulation = None (ATMEGA4809), but fails when Arduino's compatibility mode exposes PORTB as PORTBClass, where members like .IN, .DIRSET, and .OUTCLR are not available.

This change keeps the existing native ATmega4809 path untouched and adds a compatibility path using VPORTx when AVR_NANO_4809_328MODE or UNO_WIFI_REV2_328MODE is defined.

Why

This preserves support for current ATmega4809 raw-register builds while allowing Nano Every compatibility-mode builds to compile without PORTBClass errors.

Verified

  • Arduino Nano Every
  • ATmega4809
  • Registers emulation = None (ATMEGA4809)
  • Sketch compiles and uploads successfully

Chris Rusin and others added 2 commits May 17, 2026 21:26
Keep the PR focused on Nano Every ATmega4809 board support by removing local sketch configuration from the branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kalymos

kalymos commented May 18, 2026

Copy link
Copy Markdown
Owner

It's good that it's a version 9 release, but the BIOS patch timers still need to be addressed. Hopefully, they'll be identical to the 328.
Otherwise we'll have to start all over again with the logic analyzer.
I hope you're not in too much of a hurry; I won't be home until the end of the month, and I wanted to have a little more fun with the port on the RP2040s.

@ChristRm

Copy link
Copy Markdown
Author

It's good that it's a version 9 release, but the BIOS patch timers still need to be addressed. Hopefully, they'll be identical to the 328.

Otherwise we'll have to start all over again with the logic analyzer.

I hope you're not in too much of a hurry; I won't be home until the end of the month, and I wanted to have a little more fun with the port on the RP2040s.

I am not in hurry because after soldering the wires to my PS-18 motherboard my Playstation does not run any disks even if I don't plug those wires to the Arduino controller. Once I fix the problem I will be able to test the code from the current PR, but it will not be earlier than in 2 weeks

@kalymos

kalymos commented May 18, 2026

Copy link
Copy Markdown
Owner

The RP version only has the LED, the serial port, and the card generation detection that are currently functional. There's no point in rushing things, and it could lead to significant changes.

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

Successfully merging this pull request may close these issues.

2 participants