The PIC18F47Q10 features one 10-bit ADCC module. In this demo, the ADCC peripheral is used to read a value from an analog pin connected to a potentiometer a hundred times, the values passed through a low pass filter and an average is computed.
The PIC18F47Q10 Curiosity Nano Development Board is used as test platform, along with the Curiosity Nano Base for Click boards™ and the POT Click board™.
The following configurations must be made for this project:
Pin | Configuration |
---|---|
RA0 | Analog Input |
Connect the board to the PC.
Open the pic18f47q10-cnano-adcc-low-pass-filtering-mcc.X project in MPLAB® X IDE.
Set pic18f47q10-cnano-adcc-low-pass-filtering-mcc project as main project. Right click on the project in the Projects tab and click Set as Main Project:
Select the PIC18F47Q10 Curiosity Nano in the Hardware Tool section of the project settings:
Run the code in debug mode: right click on the project and click Debug:
Pause the debug process by clicking the Pause button (or click Debug -> Pause in the Menu bar):
Add adcVal variable to the Variables window: right click on the adcVal
variable in main.c file and click New Watch:
The ADC value on RA0 pin will be read only once, before the program gets to the infinite loop. The value of adcVal
will reflect the potentiometer position.
This project showcases how the Analog-to-Digital Converter with Computation (ADCC) on the new PIC18-Q10 can be used to read an analog value from a pin while removing high-frequency noise form the measurement.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。