AnsweredAssumed Answered

how many ADC sample can use in the MKE06Z128VLK4?  I cannot read 9th(SampleGroup[8])ADC data (already used 8 ADC). Plaese help!

Question asked by 育鈞 許 on May 12, 2017
Latest reply on Jun 18, 2017 by Robin_Shen

void Adc_init(void)
{
/* ADC initialization */
MyADCPtr = ADC_Init((LDD_TUserData *)NULL); /* Initialize the device */
Vr_temp_PutVal(1);
/* Create 8-sample group */
SampleGroup[0].ChannelIdx = 0U; /* ADC of Vref */
SampleGroup[1].ChannelIdx = 1U; /* ADC of T1 */
SampleGroup[2].ChannelIdx = 2U; /* ADC of T2 */
SampleGroup[3].ChannelIdx = 3U; /* ADC of T3 */
SampleGroup[4].ChannelIdx = 4U; /* ADC of T4 */
SampleGroup[5].ChannelIdx = 5U; /* ADC of T5 */
SampleGroup[6].ChannelIdx = 6U; /* ADC of T6 */
SampleGroup[7].ChannelIdx = 7U; /* ADC of VCP */
SampleGroup[8].ChannelIdx = 8U; /* ADC of current shunt */

PE_Error = ADC_CreateSampleGroup(MyADCPtr, (LDD_ADC_TSample *)SampleGroup, 8U); /* Set created sample group */
if(PE_Error != 0)
{
SS_ERROR=0x71;
}

}

void Adc_Pro(void)
{

static uint8_t ADCAverge;
uint8_t ADC_Cunter;
PE_Error = ADC_StartSingleMeasurement(MyADCPtr); /* Start continuous measurement */
if ( PE_Error )
{
SS_ERROR=0x71;
}
while (!ADC_GetMeasurementCompleteStatus(MyADCPtr)) {}; /* Wait for conversion completeness */
PE_Error = ADC_GetMeasuredValues(MyADCPtr, (LDD_TData *)MeasuredValues); /* Read measured values */
if ( PE_Error )
{
SS_ERROR=0x71;
}

Outcomes