Skip to content

Support ATtiny 0/1/2-series in attiny-hal (or new atxmega-hal) #697

Description

@ansemjo

Recently, I found that Rust now supports a wide range of AVR microcontrollers with its avr-none target. Wanting to try it out, I found your repositories and already got a somewhat functioning PoC using direct register accesses through the avr_device crate, so thanks for that!

I am wondering, how simple would it be to add support for the newer 0/1/2-series chips in attiny-hal though? These chips are not very widespread among Arduino's development boards but for custom designs these are much more interesting than the older ATtinys.

Specifically, I am interested in the ATtiny414, which I use on some of my boards. This chip is already supported in avr_device, hence I hoped that I could use it with attiny_hal as well, which is not the case. I also don't quite understand if or how I could use avr-hal-generic to "wrap" the device on my own.

While writing this issue, I saw:

However, I didn't find any one issue when looking for "1-series" or "attiny" support earlier. So, perhaps this issue can be sort of a tracking issue using those terms? :)


I do have an Arduino Nano Every flying around somewhere, that I could use for testing, as well as custom PCBs based on the ATtiny414 and ATtiny417, as mentioned. For these newer chips programmed through UPDI, I have never actually used avrdude to be honest; I always used either updiprog or pymcuprog, since the "programmer" hardware can be as simple as a resistor connecting RX and TX of a USB-TTL.

For example, the proof-of-conecpt above was flashed with something like this and the following command:

uv run --with pymcuprog pymcuprog \
  -d attiny414 -t uart -u /dev/ttyUSB0 \
  write --erase -f target/avr-none/debug/firmware.hex

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions