]>
Commit | Line | Data |
---|---|---|
1 | Hardware used | |
2 | ============= | |
3 | * Saleae clone | |
4 | * Olimex AT Mega32U4 "T" board | |
5 | https://www.olimex.com/Products/Duino/AVR/AVR-T32U4/ | |
6 | ||
7 | For "high speed" operation, the T32U4 must be jumpered to run on 5V! | |
8 | ||
9 | Software | |
10 | ======== | |
11 | * avr-gcc & companions | |
12 | * ALSA | |
13 | * LUFA | |
14 | http://www.fourwalledcubicle.com/LUFA.php | |
15 | in particular, the ClassDriver/AudioOutput demo | |
16 | LUFA-140302/Demos/Device/ClassDriver/AudioOutput/ | |
17 | ||
18 | Adapted the Makefile: | |
19 | ||
20 | 14c14 | |
21 | < MCU = at90usb1287 | |
22 | --- | |
23 | > MCU = atmega32u4 | |
24 | 16,17c16,17 | |
25 | < BOARD = USBKEY | |
26 | < F_CPU = 8000000 | |
27 | --- | |
28 | > BOARD = OLIMEXT32U4 | |
29 | > F_CPU = 16000000 | |
30 | ||
31 | [make; avrdude ...] | |
32 | ||
33 | Left channel on OC3A (pin32) -> Olimex "D5" -> probe 4. | |
34 | ||
35 | Run "aplay -D front:CARD=Demo,DEV=0 /usr/share/sounds/alsa/test.wav" | |
36 | while the Saleae records for 8 seconds. The result is pwmtest.sr. | |
37 | Probe 5 was unterminated, see the crosstalk. | |
38 | ||
39 | You can test the PWM decoder via CLI and extract the raw values: | |
40 | sigrok-cli -i pwmtest.sr -P pwm:pwm=4 -B pwm=raw > PWM.raw | |
41 | ||
42 | Add e.g. some .wav header using sox: | |
43 | sox -t raw -e unsigned -b 8 -r 64000 PWM.raw PWM.wav |