Skip to content

Commit

Permalink
add start of batch programming info
Browse files Browse the repository at this point in the history
  • Loading branch information
todbot committed Sep 17, 2024
1 parent 4d99637 commit b46582f
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
81 changes: 81 additions & 0 deletions docs/firmware-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

# Installing firmware on TouchwheelSAO board

Use any Windows, MacOS, Linux, RaspberryPi host with USB-to-serial adapter.

## Hardware prep

The TouchwheelSAO board has the UPDI programming port brought out as a 4-pin
SMD header, which a 4-pin pin header can be soldered, or a 4-pin 0.1" spacing
pogo-pin jig clamp can be attached.

The pins on the TouchWheelSAO board are laid out for use with a
[USB-to-serial adapter wired as a UPDI programmer](https://learn.adafruit.com/adafruit-attiny817-seesaw/advanced-reprogramming-with-updi)
but you can also use a standard UPDI programmer too.

Here is what a programmer setup could look like, using:
* [cheap USB-to-serial dongle](https://amzn.to/47sMaxz)
* [Pogo pin probe clip](https://www.digikey.com/short/3c99n5p9)

<a href="./firmware-programming1.jpg"><img src="./firmware-programming1.jpg" width=400></a>


## Software, Compiling, Uploading

Instead of installing the Arduino GUI, we can use [arduino-cli](https://arduino.github.io/arduino-cli/1.0/)

### Install arduino-cli

```sh
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
```

### Install megatinycore

```sh
arduino-cli core install megatinycore:megaavr --additional-urls https://drazzy.com/package_drazzy.com_index.json
```

### (optional) Show some details on the core:

```sh
arduino-cli board details -b megaTinyCore:megaavr:atxy6
```


### Compile:

```sh
arduino-cli compile --verbose -fqbn megaTinyCore:megaavr:atxy6:chip=816,printf=minimal \
--build-path=$(pwd)/build TouchwheelSAO_attiny816
```


### Upload

```sh
arduino-cli upload --verbose --fqbn megaTinyCore:megaavr:atxy6:chip=816 \
--port /dev/ttyUSB0 --programmer serialupdi57k \
--input-dir ./build

```

### Shell script for batch programming

Also see firmware/batch-program.sh

```sh
#!/bin/bash

PORT=/dev/ttyUSB0
HEX_FILE=./build/TouchwheelSAO_attiny816.ino.hex

while [ 1 ] ; do
read -rsn1 -p"Press any key program firmware"; echo
arduino-cli upload --verbose --fqbn megaTinyCore:megaavr:atxy6:chip=816 \
--port $PORT --programmer serialupdi57k \
--input-file=$HEX_FILE
echo "--------------------"
done

```
Binary file added docs/firmware-programming1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions firmware/batch-program.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Batch firmware programming of TouchWheelSAO using arduino-cli
# Requires arduino-cli to be set up as described in "firmware-install.md"

PORT=/dev/ttyUSB0
HEX_FILE=./build/TouchwheelSAO_attiny816.ino.hex

while [ 1 ] ; do
read -rsn1 -p"Press any key program firmware"; echo
arduino-cli upload --verbose --fqbn megaTinyCore:megaavr:atxy6:chip=816 \
--port $PORT --programmer serialupdi57k \
--input-file=$HEX_FILE
echo "--------------------"
done




6 changes: 5 additions & 1 deletion schematics/TouchwheelSAO/TouchwheelSAO.kicad_pro
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
"width": 0.0
}
],
"drc_exclusions": [],
"drc_exclusions": [
"lib_footprint_mismatch|182027500|100000000|db117cee-737c-4e38-9bae-adc6dc6d8dea|00000000-0000-0000-0000-000000000000",
"solder_mask_bridge|207882362|77471632|804fe2a1-0b51-4403-99d2-90168c6589a2|e4960331-6806-4396-8c2b-5fd922360b5c",
"text_thickness|209200000|77200000|6004d729-f48b-46a7-9010-33c0f774deac|00000000-0000-0000-0000-000000000000"
],
"meta": {
"version": 2
},
Expand Down

0 comments on commit b46582f

Please sign in to comment.