AVR Bare Metal Programming - Episode 10: ADC (Part 1) | Videos
AVR Bare Metal Programming - Episode 10: ADC (Part 1)
Learn how to create a bare metal ADC driver to read an analog signal and determine whether its within a user defined window. Then print that ADC result to the terminal and whether the window condition was satisfied. We will also accumulate 16 samples to cancel out random noise and use oversampling and decimation to increase the effective resolution of the ADC from 12 to 14-bits.
Additionally, we will convert the Clock Control bare metal code from the previous video into a library so it can be easily reused in other projects.
Timestamps:
00:08 In the previous video
00:49 In this video (and next 2 episodes)
01:58 Copy previous project
02:20 Clock Control library header file
03:28 Clock Control library source file
04:01 Using group position and bit position macros
08:12 Suffix for bit position and group position masks
08:33 Hardware setup
08:50 Datasheet section 33: ADC - Overview
10:46 ADC Block Diagram
11:14 ADC Signal Description
11:24 ADC Definitions
11:50 ADC Initialization procedure
13:42 ADC Initialization Delay
14:23 ADC Conversion Timing Specs
15:10 ADC Starting a Conversion
16:20 Clock Generation
17:42 Conversion Timing - Single Conversion
18:34 Conversion Timing - Accumulated Conversion
19:20 Adjusting Conversion Time
20:23 Conversion Result
21:07 Left Adjust Result
21:17 Avoiding Overflow of Result Register when Accumulating
21:49 Channel Selection - Single Ended and Differential
22:28 Internal Temperature Sensor Measurement
22:38 Window Comparator
23:13 Reducing Power Consumption by Disabling Digital Input Buffers Pins
23:26 Events
23:34 Interrupts
24:11 Sleep Mode Operation
24:26 In the next episode
Link to Tech Brief TB3262: Getting Started With Writing C-Code for AVR MCUs
https://www.microchip.com/en-us/application-notes/tb3262