We will start by getting you set up with Atmel Studio and the SAM4s Xplained Pro (Cortex M4) environment and take you through step by step tutorials on how to read analog voltages and temperature sensors using the ADC peripherals. We will achieve this together by first understanding the ADC theory, then using Atmel Studio framework and then diving deep into direct register control to configure the ADC. At the end of the course, you will learn key things to consider when programming your application to receive an analog input, and how to implement this in the ARM Cortex world.
This course content was generated from scratch in a way to get the point across to you, in the most efficient, exciting and engaging way!
ADC - Analog to Digital Converter
Lets get you setup with the environment in which we will be programming. This is Atmel Studio. I have included the download link with this lecture. If you follow the link, it will take you to Atmel's website and if you scroll down to the bottom, you can find the suitable download for your computer. Note that there is a 32 bit version and a 64 bit version. You should install the one that is compatible with your computer.
The second step is to buy the SAM4s Xplained Pro development board. I have included links for two sellers that you can buy the board from directly. This is optional, but it would be helpful for you to follow along by writing your own code and running it on your board.
Don't forget to get a micro usb cable as well, if you don't have one already!
In this lecture, you will power up the board, connect the debug USB cable to the board and load up a hello world project which turns the on board LED on when switch 0 on the board is pressed.
In this video you will learn the theory for analog to digital converters using the block diagram of the SAM4s ADC peripheral.
A few questions on things we covered in Lecture 4 about ADC Theory
This is a simulation to show the importance of sample and hold circuits used in many ADCs on the market.
Quick recap of the ADC theory we learned in this section
Introduces you to the first of 3 projects that we will be working on.
Attached document is a quick start guide provided by Atmel to use its ASF framework to get started with ADCs. There are certain inconsistencies and errors in this document, like the naming of the ADC handler function. But the following video will take you through the correct way of configuring and programming the ADC.
Quick recap of what we learned in the ADC init function
ADC timing quick recap
In project 2 we will be reading an analog signal of 1 volts on ADC 5, but we will configure the ADC by writing directly to the registers. In this video you will learn to program the ADC control register.
In this video you will learn how to program the ADC Mode Register. This is where most of the ADC timing specifications will be programmed.
In this lesson you will learn how to program the ADC Channel Enable register and ADC Interrupt Enable register.
Introduces you to the third project in this course in which you will learn how to program the on board temperature sensor of the SAM4s ARM Cortex M4 microcontroller.
In this lesson you will learn how to measure and interpret the temperature sensor reading at room temperature
In this lesson, we heat up the board using a heat gun and test the temperature sensor that you have programmed in the previous lessons!
This is a homework project for you will learn how to get the configure, enable and read the on board temperature sensor by directly writing to registers.
Akshay has 7 years of experience in firmware programming. He currently writes firmware for battery electronics that are designed for electric cars.
His educational background is in Electrical and Computer Engineering. During his masters career, he worked on an educational startup called Makermax, to teach young makers about electronics and firmware through hands on projects.
Akshay is a firm believer in learning by doing and encourages all his students to do so - Knowledge is not just learned, but also retained through hands-on projects.
In his spare time, he composes music, plays guitar, tutors high school students in math, physics, and loves to go for long hikes in the mountains.