Hello Sir,
I already have driver written, but the raw ADC count is differ in between 10-20 count.
So might be we are missing something in the logic.
If we have sample driver code,
FYI:
We are using below configuration for ADC
- Single Shot
- Software trigger
Thanks,
Nitin
Hello dear Nitin.Probably your code is working properly as you're observing a 2% drift in your data, and your problem is related to your specific hardware. some reasons affect ADC conversion value:
-You might have connected a noisy power supply to your board, and there's a ripple in your VCC, AVCC, or ADC Vref pins. (Try using decoupling capacitors and make proper filters, try using a battery as the power source and make sure your circuit is compliant with analog hardware design guides)
-The impedance of the analog input signal: Make sure the voltage that you're measuring by ADC is stable and isn't a high-impedance voltage source.
After all, if you believe hardware isn't the case, try the below sample codes, or even try software average filters in your code.
Please check out this link for ADC sample codes, ADC peripherals in the RL78 device are almost identical, so you can use them with a slight change for the D1A series. I hope you find this helpful. don't hesitate to ask further questions if needed.
Best regards. Hossein
If this or any other user's response answers your concern, kindly verify the answer. Thank you!
Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/en-support.renesas.com/.../