2017-07-12 01:30 AM
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 #udetskSolved! Go to Solution.
2017-07-13 08:33 AM
Hello Marcell ,
Warning : for Standard channel , we should PSAMP to 50
Have you configured correctly your pinmap Wizard ?
Did you arrive to End Of Conversion Interrupt ?
Best Regards
Erwan
2017-07-13 08:33 AM
Hello Marcell ,
Warning : for Standard channel , we should PSAMP to 50
Have you configured correctly your pinmap Wizard ?
Did you arrive to End Of Conversion Interrupt ?
Best Regards
Erwan
2017-07-14 02:36 AM
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
. 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