ECE 486 Support Libraries
|
For the STM32L476-Discovery board, the following peripheral assignments are used:
Pin | Peripheral | Use |
---|---|---|
PA5 | DAC Channel 2 | Primary (Mono or Stereo) output channel |
DAC Channel 1 | Stereo output channel | |
DMA2 Channel 5 | Used to move samples from a buffer to the DAC(s). | |
PA3 | OPAMP1 | Used to buffer DAC Channel 1 to drive an output pin. |
TIMER 4 | Used to trigger ADC1 and DACs. | |
PA3 | ADC1 | Primary (Mono or Stereo) input channel. |
PA2 | ADC2 | Stereo input channel. |
DMA1 Channel 1 | Used to move samples from the ADC(s) to a buffer. | |
USART2 | Serial Communication to a host terminal |
- DMA2 Channel 5 is triggered by DAC2 using request 3 - DMA1 Channel 1 is triggered by ADC1 using request 0 - ADC2 is a slave to ADC1 in dual sampling mode (Stereo input case)
DMA1 Channel 1 data is moved into an internal buffer of size ADC_Buffer_Size. Interrupts from DMA1 CHannel 1 are generated when the buffer is half-full and full, indicating that the user may process one-half of the samples, while the other half is being filled. getblocksize() returns a value of ADC_Block_Size, which is actually half of the size of the actual DMA buffer (indicating the amount of data free to be processed in each sample block).
ADC inputs and DAC output are accessed via the P1 connector on the STM32L476G-Discovery board. Pin assignments are as follows:
P1 Pin | P1 Label | ECE 486 Function |
---|---|---|
1 | 3V3 | Power (3.3~V) |
2 | GND | Ground |
3 | 2V5 | Power (2.5~V) |
4 | GND | Ground |
5 | 3V | Power (3~V) |
6 | BOOT0 | - |
7 | PB3 | 3V3_REG_ON: Tied to 3.3V Regulator via 4.7kohm |
8 | PB2 | Red LED |
9 | PE8 | Green LED |
10 | PA0 | GPIO Input: Connected to Joystic ``center" |
11 | PA5 | Primary DAC Output(MONO and STEREO) |
12 | PA1 | Primary ADC Input (MONO and STEREO) |
13 | PA2 | Second ADC Input (STEREO only) |
14 | PA3 | Second DAC Output via Opamp (STEREO only) |
15 | PB6 | I2C1_SCL |
16 | PB7 | I2C1_SDA |
17 | PD0 | EXT_RST: Configured as GPIO Digital Output |
18 | NC | - |
19 | GND | Ground |
20 | GND | Ground |