2014-04-03 03:21 AM
Hi,
I'm trying to setup an analog conversion on SPC560D40L1. I activated the ADC in HAL configuration, defined a adc-conversion-group that consists of channel 0 (ADC1_P[0] on Pin PB4). The ADC does not finish the sample. The ADCD2 state is ADC_ACTIVE and the ADC_MSR.ADCSTATUS is 0x4(Sample). The values in the buffer stay unchanged. My Settings for the conversion group ''Precision'': - Linear, Max Sequential: 4 - Watchdog functions are all disabled - Channel Settings: Inital: 0, Number of channels: 1 - Timing: CTR0_INPLATCH = 1, OFFSHIFT = 0, INPCMP = 2, INPSAMP = 9, CTR1,2 the same - No callbacks are used In the eDMA_MUX_Settings, ADC uses DMA2. My Programm looks like this: int main(void) { uint16_t adcBuffer[4]; componentsInit(); osalIsrEnable(); adcStart(&ADCD2, NULL); adcStartConversion(&ADCD2, &adc1_group_precision, &adcBuffer[0], 4); while(1) { } } The registers of ADC and eDMA seems to be right, the Clock Settings should be right, I can't find register ME_PCLT33 in the PLS-Debugger (32 and 44 are there). Thanks for help. StefanP By the way, ADC-Channel 44 can not be selected in the Conversion Group Setup.2014-04-04 05:42 AM
Hi Stefan ,
your application is working well.
1) Just 1 issue in your loop.
While(1) {} is ''skipped'' by the hightec compiler. os-less is exited and you lose your end of conversion by DMA.please add osalThreadSleepMilliseconds(500); in your loop
while(1)
{ osalThreadSleepMilliseconds(500); 0x000024D6: 70 60 01 F4 E_LI R3,0x1F4 0x000024DA: 79 FF FF 67 E_BL osalThreadSleep (0x00002440) 0x000024DE: E8 FC SE_B 0x000024D6 }After the state of ADC high level driver is well ADC_READY 😉
2) About ME_PCLT33 :
generally , to access to all registers you can use watch variable in PLS debuggers copy-paste ((ME_tag*)(0xC3FDC000)) in Watch windowsNon-Applicable for Reserved memory. (cf Reference Manual)
3) Concerning the channel 44 : i have checked in the reference manual .. in the D Family there are only 12 standards channels from 32 to 43.
i am waiting for your feedback
Best regards
Erwan Yvin
Hi,
I'm trying to setup an analog conversion on SPC560D40L1. I activated the ADC in HAL configuration, defined a adc-conversion-group that consists of channel 0 (ADC1_P[0] on Pin PB4). The ADC does not finish the sample. The ADCD2 state is ADC_ACTIVE and the ADC_MSR.ADCSTATUS is 0x4(Sample). The values in the buffer stay unchanged. My Settings for the conversion group ''Precision'': - Linear, Max Sequential: 4 - Watchdog functions are all disabled - Channel Settings: Inital: 0, Number of channels: 1 - Timing: CTR0_INPLATCH = 1, OFFSHIFT = 0, INPCMP = 2, INPSAMP = 9, CTR1,2 the same - No callbacks are used In the eDMA_MUX_Settings, ADC uses DMA2. My Programm looks like this: int main(void) { uint16_t adcBuffer[4]; componentsInit(); osalIsrEnable(); adcStart(&ADCD2, NULL); adcStartConversion(&ADCD2, &adc1_group_precision, &adcBuffer[0], 4); while(1) { } } The registers of ADC and eDMA seems to be right, the Clock Settings should be right, I can't find register ME_PCLT33 in the PLS-Debugger (32 and 44 are there). Thanks for help. StefanP By the way, ADC-Channel 44 can not be selected in the Conversion Group Setup.2014-04-04 01:05 PM
Hi Erwan,
no, this doesn't solve the problem. As you can see in the screenshot, acd is still sampling, even after 20s and no adcBuffer is written. I don't know where I have to search.2014-04-07 07:56 AM
2014-04-08 01:30 AM
Hello Stefan ,
For your information , an error report has been created for the reference manual. (Bolero 256k)In SPC5Studio side, I am checking if the CDR44in the reserved part
is accessible.If yes, we will add the channel in the SPC5Studio plugins (in the next release)i am waiting for your feedback about your ADC Applications Best Regards Erwan2014-04-08 06:29 AM
Hi Erwan,
I tried your code. When I import the Projekt I get the Information: Configuration settings ''dma_mode'' not found in instance of component ''org.chibios.spc5.components.hal.platform.spc560xx:[Element <adc_settings />]'' I'm using SPC5Studio 2.0.0. I copied your settings to my Project and got the same Problem. The ADC1-registers have the same values as on your screenshot, but ADC stays sampling. Can I send you my code via email, I'm not shure that I have removed all information (costumer/project). Thanks, StefanP2014-04-10 02:17 AM
Hi Stefan,
My email address is erwan.yvin@st.comYou can send me your application after export by email. BR Erwan2014-04-10 02:43 AM