Not applicable
Feb 07, 2016
12:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 07, 2016
12:11 AM
Hi there,
I have tried to follow the errata sheet but can't get passed the "Wait until calibration is finished" loop.Here is the code so far:
I use the XMC1100 for Arduino Evaluation Board.
//Startup Calibration
switch_on(vadc);
VADC->GLOBCFG=1<<31; //Initiate start up calibration, GLOBCFG.SUCAL = 1
VADC->GLOBCFG|=1<<16; //Disable Post calibration, GLOBCFG.DPCAL0 = 1
*((uint32_t*)0x480340E0) = 0x8000; //clear Offset calibration by writing value 00008000H to register
*((uint32_t*)0x480340E4) = 0x8000; //addresses 0x480340E0 and 0x480340E4.
while ((SHS0->SHSCFG & SHS_SHSCFG_STATE_Msk) != 0); // Wait until calibration is finished
this loop never seems to end. If I skip this loop SHS0->SHSCFG shows 0xffffffff.
Does somebody have a working startup routine?
thanks for your help.
I have tried to follow the errata sheet but can't get passed the "Wait until calibration is finished" loop.Here is the code so far:
I use the XMC1100 for Arduino Evaluation Board.
//Startup Calibration
switch_on(vadc);
VADC->GLOBCFG=1<<31; //Initiate start up calibration, GLOBCFG.SUCAL = 1
VADC->GLOBCFG|=1<<16; //Disable Post calibration, GLOBCFG.DPCAL0 = 1
*((uint32_t*)0x480340E0) = 0x8000; //clear Offset calibration by writing value 00008000H to register
*((uint32_t*)0x480340E4) = 0x8000; //addresses 0x480340E0 and 0x480340E4.
while ((SHS0->SHSCFG & SHS_SHSCFG_STATE_Msk) != 0); // Wait until calibration is finished
this loop never seems to end. If I skip this loop SHS0->SHSCFG shows 0xffffffff.
Does somebody have a working startup routine?
thanks for your help.
- Tags:
- IFX
2 Replies
Feb 07, 2016
01:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 07, 2016
01:17 AM
did you verify "switch_on(vadc)" working correctly?
Most likely you didn't activate the ADC clock, SHSCFG reads then 0xffffffff.
See the library code XMC_SCU_CLOCK_UngatePeripheralClock(), although it's author likely didn't remember that SCU_CLK->CGATCLR0 is a "write only" bit clear register, therefore you shouldn't use the read-modify-write as infineon code does but simply write a one bit at the correct place.
BTW: You should write whether you use AA or AB step silicon.
Most likely you didn't activate the ADC clock, SHSCFG reads then 0xffffffff.
See the library code XMC_SCU_CLOCK_UngatePeripheralClock(), although it's author likely didn't remember that SCU_CLK->CGATCLR0 is a "write only" bit clear register, therefore you shouldn't use the read-modify-write as infineon code does but simply write a one bit at the correct place.
BTW: You should write whether you use AA or AB step silicon.
Not applicable
Feb 07, 2016
01:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 07, 2016
01:47 AM
Obetz, thanks,
your comment prompted me to double check this.
And really, VADC was not de-asserted because a wrong number had been assigned to 'vadc' when calling "switch_on(vadc);"
your comment prompted me to double check this.
And really, VADC was not de-asserted because a wrong number had been assigned to 'vadc' when calling "switch_on(vadc);"