There are may method the data (or sensor data) can be receive by MCU such as: SPI bus, IIC bus, ADC. We will be touching on SPI/IIC in future, for this lesson, our focus will be on ADC, which stands for 'Analog to Digital Converter'. As the name imply, the functionality of ADC is to convert analog signal(in this case is voltage) to binary data.
Take temperature sensor as example, when the temperature is changing, the resistance of the sensor will varies. Using this characteristic and apply the sensor into voltage divider circuit, we will have a voltage output that change according to the temperature. By using ADC, MCU can know the current voltage level, thus enabling system to know current temperature.
After reading the ADC section in Reference Manual (RM0360), there is actually an internal temperature sensor (Vsense). This would be an good example to demonstrate ADC function in reading temperature.
p.s:
Despite the idea of demostrating tempeature reading, it appears that much more work is require in order to perform a proper temperature reading, as described in RM0360: Section 12.9. Thus, the example would only demonstrate a ADC value change (increase) correspond to temperature increase.
Controlling ADC
Key function to enabling ADC is summarizes as below:- Enable ADC peripheral
- Configurations on ADC
- ADC channel selection
- Start ADC process
- Wait for ADC process complete, then read the result
No comments:
Post a Comment