{"id":20522867,"url":"https://github.com/anachrocomputer/stm32_mcp4822","last_synced_at":"2026-05-08T08:35:13.062Z","repository":{"id":178747450,"uuid":"637988830","full_name":"anachrocomputer/STM32_MCP4822","owner":"anachrocomputer","description":"STM32F411 Black Pill programs with the MCP4822 dual 12-bit SPI DAC","archived":false,"fork":false,"pushed_at":"2024-05-29T21:14:34.000Z","size":151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-06T19:58:05.810Z","etag":null,"topics":["blackpill","dds","direct-digital-synthesis","mcp4822","midi","oled","oled-display-ssd1351","spi","ssd1351","stm32","stm32f4"],"latest_commit_sha":null,"homepage":"","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/anachrocomputer.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":"2023-05-08T21:01:52.000Z","updated_at":"2024-05-29T21:14:38.000Z","dependencies_parsed_at":"2025-01-16T10:43:10.237Z","dependency_job_id":"1bc4622f-5a5a-42f3-9c9e-de2a368e5b2b","html_url":"https://github.com/anachrocomputer/STM32_MCP4822","commit_stats":null,"previous_names":["anachrocomputer/stm32_mcp4822"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anachrocomputer/STM32_MCP4822","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FSTM32_MCP4822","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FSTM32_MCP4822/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FSTM32_MCP4822/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FSTM32_MCP4822/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anachrocomputer","download_url":"https://codeload.github.com/anachrocomputer/STM32_MCP4822/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FSTM32_MCP4822/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32773280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blackpill","dds","direct-digital-synthesis","mcp4822","midi","oled","oled-display-ssd1351","spi","ssd1351","stm32","stm32f4"],"created_at":"2024-11-15T22:37:09.200Z","updated_at":"2026-05-08T08:35:13.045Z","avatar_url":"https://github.com/anachrocomputer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Static Badge](https://img.shields.io/badge/MCU-STM32-green \"MCU:STM32\")\n![Static Badge](https://img.shields.io/badge/DAC-MCP4822-green \"DAC:MCP4822\")\n\n# STM32_MCP4822 #\n\nSome simple STM32 programs to explore analog output via the Microchip\nMCP4822 dual 12-bit DAC.\n\nThe programs are in C and may be compiled with 'arm-none-eabi-gcc'\non Linux.\nThey generate ELF and BIN output files which are suitable to program\ninto STM32 chips for testing purposes.\n\nThe 'Makefile' also has targets for the STM32 programming tool 'stlink'.\n\n## Chips Supported ##\n\nAt present, there's only support for the STM32F411 on the Black Pill\ndevelopment board.\nThe main reason for this choice of chip is that I have dev boards\nfor those chips that I can use for testing.\nAlso, the STM32F411 has a hardware floating-point unit (FPU) which may\nprove to be useful for these programs.\n\n## ARM Toolchain ##\n\nThe programs have been compiled, linked and tested using a Linux version\nof the 'arm-none-eabi-gcc' toolchain.\nThis can be installed directly or as part of the Arduino IDE.\n\nThe compiler, linker, and programmers are invoked from the Makefile in\nthe usual way.\nVarious parameters in the Makefile may be altered to suit the development\nsetup, e.g. the type of programmers used and the ports that they connect to.\nThe full pathname to the toolchain is also configured in the Makefile.\n\nSpecial targets in the Makefile are provided to invoke the programming\ndevice(s) and write the BIN files into the Flash memory in the chips.\nThese targets are called 'prog' and 'progdds'.\n\nThere's a Makefile target called 'clean' that deletes the object code files\nand the ELF and BIN binary files.\nIt leaves the source code files untouched, of course.\n\n## STM32 Programmers ##\n\nI have tested the code with an 'ST-LINK V2' programmer.\n\n## Test Setup ##\n\nBlinking LEDs, of course!\nThe LED should blink at 1Hz (500ms on, 500ms off).\nThis frequency may be measured as a means of verifying correct\nclocking of the STM32 chip.\n\nOn the STM32F411, a 500Hz square wave should be generated on pin PC14.\nThere's also a scope sync or trigger pulse on PB12 that is in phase with the\nsignal generated by the DDS.\n\u003c!--- The chip also generates a timing test pulse on PC2\n(HIGH during the DDS ISR, LOW otherwise). ---\u003e\nPC13 is the 1Hz LED.\n\nAnalog signals are read via ADC1 on ADC1\\_IN1 and ADC1\\_IN8.\nMore ADC inputs to be added later.\n\nThe serial port(s) should transmit a message at 9600 baud.\n\nSerial input is accepted on UART0.\n\u003c!--- All the chips accept a letter 'r' to print the reset reason and\n'~' to invoke a software reset.\nThe ATtiny1616 and ATmega4809 also accept 'i' to print the chip ID\nbytes, 'n' to print the unique serial number and 'f' to print the\nvalues of the fuse registers. ---\u003e\n\nTo select different waveforms, the chips accept 's' for a sinewave,\n'q' for a squarewave, 't' for a triangle wave, and 'w' for a sawtooth.\nThis may change to become voltage-controlled in a future version.\n\n## Future Enhancements ##\n\n* Implement external op-amp connected to MCP4822\n* Implement active low-pass filter on MCP4822 output\n* Make waveform selection voltage-controlled\n* Add more waveforms\n* Store waveforms in Flash memory\n* Add more control voltage (CV) analog inputs\n* Test with other ARM chips (e.g. STM32F103 on Blue Pill)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanachrocomputer%2Fstm32_mcp4822","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanachrocomputer%2Fstm32_mcp4822","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanachrocomputer%2Fstm32_mcp4822/lists"}