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