RA4M1 microcontroller has 2-channels of 8-bit DAC and 1-channel of 12-bit DAC. 12-bit DAC has output amplifier and 8-bit DAC doesn’t have output amplifier. The 8-bit DAC output is given to the on-chip comparator as reference voltage. 12-bit DAC output is available on the A0 pin of the Arduino Uno R4 Wi-Fi. The range of the output is from 0 to 3.3V. 12-bit DAC is preferred for smooth LED fading. We can see the DAC output highlighted in green (P014_AN09_DAC) in the below snapshot of the schematic.
Pin (Arduino Connector) |
MCU Pin |
Functionality |
Remarks |
|---|---|---|---|
DAC0 (A0) |
RA0 |
12-bit DAC, Analog In |
True analog output, 0–3.3V, use for LED dimming |
D2 – D13 |
- |
Digital I/O, PWM capable |
8-bit PWM output, can simulate analog voltage |
D9, D10, D11, D12, D13 |
- |
8-bit DAC output via PWM |
Simulated analog output (not true DAC) |
While using the A0 pin for the 12-bit DAC, unfortunately with the Arduino Core, it uses only 8-bit output and not full 12-bit. So, the maximum analog value of 3.3V on A0 pin will be reached for a value of 255 max. DAC value.
Below is the code for the same:Here is the link to the video from our YouTube Channel Way2Know:
0 Comments