cancel
Showing results for 
Search instead for 
Did you mean: 

ADC example for SPC560B-DIS not working

fiinfi
Associate II

I imported the SPC560Bxx_RLA ADC example. As I understand, this example use ADC conversion with DMA, and the ADC value will be converted to the delay time between each time LED D8 is toggled.

But some type like uint32_t could not be resolved and I tried this, I added these path to my project properties "path and symbols":

C:\SPC5Studio-6.0\eclipse\plugins\com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.20200908161514\toolchain\include

C:\SPC5Studio-6.0\eclipse\plugins\com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.20200908161514\toolchain\include\sys

C:\SPC5Studio-6.0\eclipse\plugins\com.st.tools.spc5.tools.gnu.gcc.ppcvle.win32_4.9.4.20200908161514\toolchain\lib\gcc\powerpc-eabivle\4.9.4\include

and it could be built then.

But the problem is I did not see any difference of LED's blinking when I connect the PB[8] pin to VCC pin. in UDE window I did not see any change in "samples[0]" variable. So ADC was not working?

I noticed this statement: "adc_lld_start(&ADCD2, NULL);" is this "NULL" an error? I do not understand this. can anyone explain this to me, and did it cause my problem or I included gcc wrong or something else?

thanks for reading.

1 ACCEPTED SOLUTION

Accepted Solutions
fiinfi
Associate II

The ADC's supply voltage does not exist due to the J4 and J7 connector are not closed, after I closed these two connectors, the ADC example ran as expected

 

View solution in original post

2 REPLIES 2
fiinfi
Associate II

update: It turns out I set up power on the board wrong, now I close J19 and J20 and my ADC value is updated, but the problem is it seems only updated once when run the conversion start statement the first time, after that when I pull down or pull up this ADC pin, ADC value does not change???

fiinfi
Associate II

The ADC's supply voltage does not exist due to the J4 and J7 connector are not closed, after I closed these two connectors, the ADC example ran as expected