You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the CANRX and CANTX pins are not attached to the ADC, and they were incorrectly documented, likely due to previous boards with form factor having these pins as A14/15
Copy file name to clipboardExpand all lines: content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-audio/content.md
+48-48Lines changed: 48 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Guide to GIGA R1 Advanced ADC/DAC and Audio Features
3
-
description: 'Learn how to use the ADC/DAC features, along with useful examples on how to generate waveforms and play audio from a file.'
3
+
description: "Learn how to use the ADC/DAC features, along with useful examples on how to generate waveforms and play audio from a file."
4
4
author: José Bagur, Taddy Chung & Karl Söderby
5
5
hardware:
6
6
- hardware/10.mega/boards/giga-r1-wifi
@@ -11,15 +11,16 @@ software:
11
11
tags: [ADC, DAC, Audio, USB]
12
12
---
13
13
14
-
In the GIGA R1, you can find the powerful STM32H747XI, a dual-core 32-bit Arm® Cortex® microcontroller from STMicroelectronics; this is the same microcontroller found in the [Portenta H7](/hardware/portenta-h7) board.
14
+
In the GIGA R1, you can find the powerful STM32H747XI, a dual-core 32-bit Arm® Cortex® microcontroller from STMicroelectronics; this is the same microcontroller found in the [Portenta H7](/hardware/portenta-h7) board.
15
15
16
16
In this guide, we will focus on the advanced ADC/DAC features, utilizing the [Arduino_AdvancedAnalog](https://github.com/arduino-libraries/Arduino_AdvancedAnalog) library. The examples found in this guide can be used to:
17
-
- Set up and read ADCs with specific parameters (resolution, sample rate, number of samples per channel, queue depth).
18
-
- Set up and write to a DAC channel with specific parameters (resolution, frequency, number of samples per channel, queue depth).
17
+
18
+
- Set up and read ADCs with specific parameters (resolution, sample rate, number of samples per channel, queue depth).
19
+
- Set up and write to a DAC channel with specific parameters (resolution, frequency, number of samples per channel, queue depth).
19
20
- Generate specific waveforms through input via serial commands (triangle, square, sine, sawtooth waves) as well as adjusting the frequency.
20
21
- Read and play audio files (`.wav`) from a USB stick (connected to USB-A) to a speaker, using the audio jack.
21
22
22
-
***Important note: the GIGA R1 does NOT have an amplifying circuit onboard. Connecting speakers that does not have an amplifier can damage the DAC and the board itself.***
23
+
**_Important note: the GIGA R1 does NOT have an amplifying circuit onboard. Connecting speakers that does not have an amplifier can damage the DAC and the board itself._**
23
24
24
25
## Hardware & Software Needed
25
26
@@ -45,34 +46,32 @@ The image below shows the position of the audio pins and connectors of the GIGA
45
46
46
47

47
48
48
-
The table below explains the full functionality of the listed on it; notice that some pins have more than one functionality, such as `DAC0`, `DAC1`, `CANRX`, and `CANTX`:
49
-
50
-
| Pin | Functionality |
51
-
|:-----:|:--------------:|
52
-
| A0 | ADC |
53
-
| A1 | ADC |
54
-
| A2 | ADC |
55
-
| A3 | ADC |
56
-
| A4 | ADC |
57
-
| A5 | ADC |
58
-
| A6 | ADC |
59
-
| A7 | ADC |
60
-
| A8 | ADC |
61
-
| A9 | ADC |
62
-
| A10 | ADC |
63
-
| A11 | ADC |
64
-
| DAC0 | ADC and DAC |
65
-
| DAC1 | ADC and DAC |
66
-
| CANRX | ADC and CAN RX |
67
-
| CANTX | ADC and CAN TX |
49
+
The table below explains the full functionality of the listed on it; notice that `A12` and `A13` can be used as DACs (`DAC0`, `DAC1`).
50
+
51
+
| Pin | Functionality |
52
+
| :--------: | :------------: |
53
+
| A0 | ADC |
54
+
| A1 | ADC |
55
+
| A2 | ADC |
56
+
| A3 | ADC |
57
+
| A4 | ADC |
58
+
| A5 | ADC |
59
+
| A6 | ADC |
60
+
| A7 | ADC |
61
+
| A8 | ADC |
62
+
| A9 | ADC |
63
+
| A10 | ADC |
64
+
| A11 | ADC |
65
+
| A12 / DAC0 | ADC and DAC |
66
+
| A13 / DAC1 | ADC and DAC |
68
67
69
68
Pins `A7`, `DAC0`, and `DAC1` can also be accessed via the built-in TRRS 3.5mm jack. `DAC0` is connected to ring 1 (right channel), `DAC1` is connected to the tip (left channel), and `A7` is connected to ring 2 (microphone) of the jack, as shown in the schematic below:
70
69
71
70

72
71
73
72
## Analog-to-Digital Converter (ADC)
74
73
75
-
An analog-to-digital converter (ADC) is a device that converts an analog voltage, or signal, into digital data. The GIGA R1 microcontroller, the STM32H747XI, embeds three ADCs whose resolution can be configured to 8, 10, 12, 14, or 16 bits. Each ADC shares up to 20 external channels that can be accessed in the GIGA R1 board through pins `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `A7`, `A8`, `A9`, `A10`, and `A11`; pins `DAC0`, `DAC1`, `CANRX`, and `CANTX` can also be used as ADCs.
74
+
An analog-to-digital converter (ADC) is a device that converts an analog voltage, or signal, into digital data. The GIGA R1 microcontroller, the STM32H747XI, embeds three ADCs whose resolution can be configured to 8, 10, 12, 14, or 16 bits. Each ADC shares up to 20 external channels that can be accessed in the GIGA R1 board through pins `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`, `A7`, `A8`, `A9`, `A10`, and `A11`; pins `DAC0`, `DAC1` can also be used as ADCs.
76
75
77
76

78
77
@@ -171,7 +170,7 @@ A digital-to-analog converter (DAC) is a device that has a function opposite to
171
170
172
171
- 8-bit or 12-bit monotonic output
173
172
- Left or right data alignment in 12-bit mode
174
-
- Dual DAC channel independent or simultaneous conversions
173
+
- Dual DAC channel independent or simultaneous conversions
175
174
- DMA capability for each channel
176
175
- External triggers for conversion
177
176
- Input voltage reference or internal voltage reference
***\*USB mass storage devices connected needs to be formatted with the FAT32 as a file system, using the MBR partitioning scheme. Read more in the [USB Mass Storage](/tutorials/giga-r1-wifi/giga-usb/#usb-mass-storage) section.***
474
+
**_\*USB mass storage devices connected needs to be formatted with the FAT32 as a file system, using the MBR partitioning scheme. Read more in the [USB Mass Storage](/tutorials/giga-r1-wifi/giga-usb/#usb-mass-storage) section._**
475
475
476
476
### USB Stick Configuration
477
477
478
-
The **Arduino_AdvancedAnalog** library contains the necessary functions that enable us to use the advanced capabilities of the GIGA R1 DACs.
478
+
The **Arduino_AdvancedAnalog** library contains the necessary functions that enable us to use the advanced capabilities of the GIGA R1 DACs.
479
479
480
-
To read `.wav` files from the USB stick we are using the **Arduino_USBHostMbed5** library. It is important that the USB stick is formatted properly, and that we define its name in the sketch. In this case, we name it `USB_DRIVE`, and is defined like this:
480
+
To read `.wav` files from the USB stick we are using the **Arduino_USBHostMbed5** library. It is important that the USB stick is formatted properly, and that we define its name in the sketch. In this case, we name it `USB_DRIVE`, and is defined like this:
481
481
482
-
```arduino
482
+
```arduino
483
483
mbed::FATFileSystem usb("USB_DRIVE");
484
484
```
485
485
@@ -663,7 +663,7 @@ This example is similar to the **Play Single Audio File** example, but with some
663
663
664
664
- This example uses multiple audio files.
665
665
- The file read is moved to a separate function, `configFile()`, as it will be continuously called from the sketch.
666
-
- Instead of playing a file once, it keeps looping it.
666
+
- Instead of playing a file once, it keeps looping it.
667
667
- The **BOOT0** (`PC_13`) button (right next to the audio jack) is used as a regular pushbutton to loop through the audio files.
0 commit comments