2022-10-20 02:52 AM
I tried to change the chanel number but it didn't work, and i also tried to change the driver under test but it gives me an error.
here is my void mainhere is the pin map
2022-10-20 07:18 AM
Hello,
Tel me if I am wrong, but I suppose that what you need it to read 2 input analogue values simultaneously.
If so, you do not need to open 2 drivers but only one which is able to read several channels (eg 2 channels).
You are using SPC584B-DISP Discovery2 board.
You can find useful information in the User-manual :
https://www.st.com/resource/en/user_manual/um2462-spc584bdisp-discovery-board-stmicroelectronics.pdf
You can find that many ADC channels are mapped to X9 connector:
For example, with the 2 firsts, PI3_ADC-AN39 and PI5_ADC-AN41, it means channel 39 can be programmed as input pad I[3] of MCU and connected to X9:B26.
And channel 41 can be programmed as input pad I[5] of MCU and connected to X9:A27.
In pin map wizard you can program PI3 to input ADC_SAR_12b_SV_0:
you can also program PI5 to input ADC_SAR_12b_SV_0:
In low level drivers component – saradc settings:
You can keep the Supervisor driver only
In channels configuration, you must have channels 39 and 41:
Then you can modify the demo code “SPC584Bxx_RLA SARADC Test Application for Discovery 2�? with
#define NUMOFCHANNELS 2U
And
uint8_t anp[NUMOFCHANNELS] = {39U, 41U};
uint16_t value[NUMOFCHANNELS] = {0U, 0U};
This way value[0] and value[1] will contains values from ADC channel 39 and 41
Best regards.