32 lines
1.1 KiB
Markdown
32 lines
1.1 KiB
Markdown
|
|
# Overview
|
|
|
|
This uses an AVR microcontroller (ATMega328P-PU).
|
|
- Microconroller: https://git.onewaycoding.com/jay/tone-generator
|
|
- MIDI parser: https://git.onewaycoding.com/jay/midi-parser
|
|
|
|
![Project](Project.jpg)
|
|
|
|
# Pin Description
|
|
|
|
| Pin(s) | Purpose |
|
|
|--------|----------------------------------|
|
|
| 0-7 | 8-bit DAC (for audio) |
|
|
| 8 | Next button |
|
|
| 9-10 | LEDs |
|
|
| 11-13 | ISP Programmer, otherwise unused |
|
|
| A0-A3 | Serial: DTR, TXD, RXD, CTS |
|
|
| A4-A5 | I2C: SDA, SCL |
|
|
|
|
# Instruction Set
|
|
|
|
| ID | Name | Size | Layout |
|
|
|-|-|-|-|
|
|
| 0 | stop | 1 | id (3), empty (5) |
|
|
| 1 | setup | 8 | id (3), us_per_tick (29), amplitude (8), size (24) |
|
|
| 2 | set | 3 | id (3), index (5), frequency (12), mode (2), gain(2) |
|
|
| 3 | set-ts | 5 | id (3), index (5), ticks (16), frequency (12), mode (2), gain (2) |
|
|
| 4 | clear | 1 | id (3), index (5) |
|
|
| 5 | clear-ts | 3 | id (3), index (5), ticks (16) |
|
|
|