{"id":19998081,"url":"https://github.com/shorepine/amychip","last_synced_at":"2025-05-04T14:30:50.506Z","repository":{"id":258002207,"uuid":"864623300","full_name":"shorepine/amychip","owner":"shorepine","description":"AMY running on a chip, communicating over i2c or SPI etc ","archived":false,"fork":false,"pushed_at":"2024-11-06T22:29:21.000Z","size":108,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-06T23:26:04.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shorepine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-28T17:58:36.000Z","updated_at":"2024-11-06T22:29:24.000Z","dependencies_parsed_at":"2024-10-17T08:53:43.208Z","dependency_job_id":null,"html_url":"https://github.com/shorepine/amychip","commit_stats":null,"previous_names":["shorepine/amychip"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shorepine%2Famychip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shorepine%2Famychip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shorepine%2Famychip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shorepine%2Famychip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shorepine","download_url":"https://codeload.github.com/shorepine/amychip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224393949,"owners_count":17303725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T05:07:18.835Z","updated_at":"2024-11-13T05:07:36.378Z","avatar_url":"https://github.com/shorepine.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AMY on a chip \n\nThis repository collects \"AMYchip\" implementations, where we run the [AMY](https://github.com/shorepine/AMY) synthesizer on a full chip (doing nothing else), servicing requests over i2c (and future, SPI etc).\n\nWe have\n - [`esp32s3`](https://github.com/shorepine/amychip/tree/main/esp32s3)\n\nAnd soon want to have\n - `rp2350`\n - `esp32p4`\n - `daisy`\n\n\n## How to\n\nClone AMY into a folder next to this one. For now, use the `main` branch of AMY\n\n```bash\ngit clone https://github.com/shorepine/amy\ngit clone https://github.com/shorepine/amychip\n```\n\n\nSet your I2S and I2C pins at the top of the `amychip.c` in your chip's folder:\n\n```c\n#define I2S_BCLK 13 \n#define I2S_LRCLK 12\n#define I2S_DIN 11 // data going to the codec, eg DAC data\n#define I2C_SLAVE_SCL 5  \n#define I2C_SLAVE_SDA 4 \n#define I2C_MASTER_SCL 17\n#define I2C_MASTER_SDA 18\n#define I2S_DOUT 16 // data coming from the codec, eg ADC  data\n```\n\nSet up your DAC / ADC codec. I'm using the [`WM8960`](https://www.sparkfun.com/products/21250) codec. Wire it up like:\n\n```\nTulip or etc I2C/Mabee/Grove SCL -\u003e I2C_SLAVE_SCL\nTulip or etc I2C/Mabee/Grove SDA -\u003e I2C_SLAVE_SDA\nTulip or etc I2C/Mabee/Grove GND -\u003e MCU GND\nTulip or etc I2C/Mabee/Grove 3.3V -\u003e MCU 3V3\nUSB 5V -\u003e MCU (we need 5V to power this codec)\nWM8960 GND -\u003e Audio in sleeve/GND\nWM8960 LINPUT1 -\u003e Audio in L\nWM8960 RINPUT1 -\u003e Audio in R\nWM8960 HPL -\u003e Audio out L\nWM8960 OUT3 -\u003e Audio out sleeve  *** NOTE: Audio-out \"ground\" is actually a special \"mid-voltage\" on OUT3\nWM8960 HPR -\u003e Audio out R\nWM8960 BLCK -\u003e I2S_BCLK\nWM8960 DACLRC -\u003e I2S_LRCLK (shared)\nWM8960 DACDAT -\u003e I2S_DIN\nWM8960 ADCLRC -\u003e I2S_LRCLK (shared)\nWM8960 ADCDAT -\u003e I2S_DOUT\nWM8960 SCL -\u003e I2C_MASTER_SCL\nWM8960 SDA -\u003e I2C_MASTER_SDA\nWM8960 3V3 -\u003e MCU 3V3\nWM8960 VIN -\u003e MCU 5V \nWM8960 GND -\u003e MCU GND \n```\n\nCompile / flash `amychip` using the instructions in the chip's folder.\n\nControl the chip over I2C. In e.g. Tulip, that's as simple as \n\n```python\nfrom machine import I2C\nimport amy\ni2c = I2C(0, freq=400000)\n\namy.override_send= lambda x : i2c.writeto(0x58, bytes(x.encode('ascii')))\namy.send(reset=amy.RESET_TIMEBASE, time=tulip.ticks_ms()) # Restart the clock\n```\n\nYou can get this on Tulip World:\n\n```python\nworld.download('amychip.py')\nexecfile('amychip.py')\n```\n\n\n## Protocol\n\nFor now, over i2c, we just send AMY messages encoded as ASCII to `0x58`. Nothing gets returned. \n\nTODO:\n - ~~`memorypcm` / sample loading~~\n - stderr feedback over I2C\n - `sequencer.c`, sending interrupts to the \"main\" i2c host\n - SPI? UART? \n\n \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshorepine%2Famychip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshorepine%2Famychip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshorepine%2Famychip/lists"}