cancel
Showing results for 
Search instead for 
Did you mean: 

SPC560P ADC value not updating

Marcell Daniel
Associate II
Posted on July 12, 2017 at 10:30

Hello,

I am workin on SPC560P Discovery Board. I am trying to initialize the ADCperipheral using the components provided in the SPC5 Studio. What I am trying to do is to replicate the ADC Test Application in a different project. I initialize the ADC component in the project configuration andusing this in the main.c

#include 'components.h'
#include 'adc_lld_cfg.h'
static adcsample_t samples[ADC1_GROUP_ADC1_CONF_NUM_CHANNELS *
 ADC1_GROUP_ADC1_CONF_BUF_DEPTH];
static uint32_t mswaittime;

int main(void) {
 componentsInit();
 irqIsrEnable();
 adc_lld_start(&ADCD2, NULL);
 sysWaitMilliseconds(1000UL);
 while(1) { 
 adc_lld_start_conversion(&ADCD2, &adc1_group_ADC1_conf,
 samples, ADC1_GROUP_ADC1_CONF_BUF_DEPTH);
 mswaittime = samples[0];
 sysWaitMilliseconds(100UL+mswaittime);�?�?�?�?�?�?
}
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Configuring the ADC I am using the same values provided in the ADC Test Application (channel: 10).

The problem is after loading the program on the board, that the ADC sample values are not updating, but remaining on a constant value. Removing the jp12 jumper is setting the sample value to 1, but changing the resistor has no effect on the sample value.

Can you help me out what am I missing here?

Regards,

Marcell

#spc560p #adc #spc5studio #udetsk
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee
Posted on July 13, 2017 at 17:33

Hello Marcell ,

Warning : for Standard channel , we should PSAMP to 50 

Have you configured correctly your pinmap Wizard ?

0690X00000607aZQAQ.png

Did you arrive to End Of Conversion Interrupt ?

   Best Regards

         Erwan

View solution in original post

2 REPLIES 2
Erwan YVIN
ST Employee
Posted on July 13, 2017 at 17:33

Hello Marcell ,

Warning : for Standard channel , we should PSAMP to 50 

Have you configured correctly your pinmap Wizard ?

0690X00000607aZQAQ.png

Did you arrive to End Of Conversion Interrupt ?

   Best Regards

         Erwan

Posted on July 14, 2017 at 09:36

Thanks Erwan!

Somehow I forgot the Pinmap Wizard again, now it is works as expected. 

While I am here may i ask about the FlexRay driver? I found many thread here asking about the Flexray driver and I understand that SPC5 studio is not containing support for Flexray, nor it is planned in the near future. However you wrote that the driver is available in the SPC5 MCAL package which can be download under this

https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/spc5-embedded-software/stsw-spc56as003.license%3d1499936172099.html

. This page contains a Request Software. I filled the form out and requested the software and now it says its under Validating

Edit: I was finally able to download the Autosar 4 MCAL package. I submitted my license request to 

mailto:apgtools-license@st.com

 for a Demo version. I am waiting for the Serial Number so i can install the package.

Thanks for helping me!

Regards,

    Marcell