https://github.com/anachrocomputer/pic32dds
Direct Digital Synthesis via an MCP4822 SPI DAC on a PIC32MX550F256L. Should also work on other PIC32MX chips with similar peripherals, e.g. PIC32MX250F256L.
https://github.com/anachrocomputer/pic32dds
dac dds direct-digital-synthesis mcp4822 pic32 pic32mx spi
Last synced: 4 months ago
JSON representation
Direct Digital Synthesis via an MCP4822 SPI DAC on a PIC32MX550F256L. Should also work on other PIC32MX chips with similar peripherals, e.g. PIC32MX250F256L.
- Host: GitHub
- URL: https://github.com/anachrocomputer/pic32dds
- Owner: anachrocomputer
- Created: 2019-01-17T23:44:43.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-30T13:44:59.000Z (about 1 year ago)
- Last Synced: 2025-03-06T00:44:38.240Z (10 months ago)
- Topics: dac, dds, direct-digital-synthesis, mcp4822, pic32, pic32mx, spi
- Language: C
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README



# PIC32DDS #
Generate audio-frequency signals from an MCP4822 dual 12-bit DAC
connected via SPI to a PIC32MX550F256L.
SPI2 clock at 2MHz, SPI3 clock at 1MHz.
New samples sent to DAC at 44.1kHz.
SPI3 connects to an OLED display module, 128x64 pixel,
based on the SSD1306 chip.
SYNC pin set HIGH at beginning of synthesised waveform cycle and LOW
at the end.
DAC connections:
| Signal | Chip | Name | Pin | Chip | Name | Pin |
|--------|-------|-----------|-----|---------|------|-----|
| SCK2 | PIC32 | RG6/SCK2 | 10 | MCP4822 | SCK | 3 |
| MOSI2 | PIC32 | RC13/SDO2 | 73 | MCP4822 | SDI | 4 |
| SS2 | PIC32 | RD9 | 69 | MCP4822 | CS | 2 |
OLED display connections:
| Signal | Chip | Name | Pin | Chip | Name | Pin |
|--------|-------|-----------|-----|---------|------|-----|
| SCK3 | PIC32 | RF13/SCK3 | 39 | SSD1306 | SCK | 3 |
| MOSI3 | PIC32 | RG8/SDO3 | 12 | SSD1306 | SDA | 4 |
| SS3 | PIC32 | RA0 | 17 | SSD1306 | CS | 7 |
| DC | PIC32 | RG9 | 14 | SSD1306 | DC | 6 |
| RES | PIC32 | RE8 | 18 | SSD1306 | RES | 5 |
Digital output:
* SYNC RD0 pin 72
Debugging LEDs on dev board:
* LED1 RE6 pin 4
* LED2 RE7 pin 5
* LED3 RE1 pin 94
* LED4 RA7 pin 91
* LED5 RA6 pin 92
PIC32 pin numbers are for the 100-pin package.
LEDs light when the pin is pulled LOW.
## PIC32 Toolchain ##
MPLAB X V6.20 and 'xc32' V4.60.
These are not quite the latest versions,
but MPLAB X V6.20 is the last version to support my "long obsolete" ICD3 programmer.
## PIC32 Programmer ##
Microchip ICD3.
Other programmers should work, e.g. ICD4 or PICkit4.