I am working on R5F10BLG 64pin MCU.
i want to use 8 adc channels, i.e. ANI0 to ANI7.
CS+ generates ADC code but i am unable to understand how to scan ADC input from all pins one by one, i.e. which SFR/ function needs to be changed/called to change input pin selection.
For scanning 8 channels of ADC inputs, you will have to change the ADC channel number after each previous ADC conversion is done. First, you can choose one of these ADC modes in registers ADM0 and ADM1: 1. ADC Software trigger: Select mode, One-shot conversion mode 2. ADC Hardware trigger no-wait: Select mode, One-shot conversion mode 3. ADC Hardware trigger wait mode: Select mode, One-shot conversion mode After your start the ADC conversion, and each ADC conversion is complete, service the ADC completion interrupt, and store the ADC results. Then modify the ADS register with the next ANIn input channel number you want, and set the ADC Software trigger, or if HW trigger wait for the next Timer trigger. The RL78/F13, F14 HW User's manual, Chapter 12, A/D Converter explains all the required settings for the ADC registers to set ADM0 and ADM1. Regards, Mike
In addition to what Mike said, you need to look and modify the value of the ADS register after each conversion is done to change the input channel. You can refer to the hardware manual chapter 12.3.7 for the ADS register configuration.
JBRenesasRulz Forum Moderator
Glad it worked! You're welcome :)
I was looking for an example code for G13 on CS+ to read multiple ADC simultaneously. Please help to share any example code...
This post is very old and will be locked. Please create a new question for this request. Thank you!
If this response, or one provided by another user, answers your question, please verify the answer. Thank you!Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/