Hello NXP talents,
In my application, the SDADC_2 data valid event output is configured as input of ETPUB channel 10. I expect the util_etpu_gpio_pin_history() function will return 1 when the Data Valid Flag is 1, but the util_etpu_gpio_pin_history() function always return 0.
The below is my code:
/* Divider 64 for SD_CLK (max 16MHz, min 4MHz) i.e.264/64 = 4.125MHz */
SIU.SDCLKCFG.R = 0x0000003F;
/* enable SDADC in the single-ended mode */
SDADC_2.MCR.R = 0x00000003;
/* INP (positive terminal) = AN
INM (negative terminal) = VREFN */
SDADC_2.CSR.R = 0x0;
/* set output settling delay to max */
SDADC_2.OSDR.R = 0xFF;
/* FIFO 16 words deep, enabled */
SDADC_2.FCR.R = 0x107;
/* Enable data valid event output */
SDADC_2.RSER.R = 0x00000004;
/* send key to reset ADC to start sampling */
SDADC_2.RKR.R = 0x5AF0;
void main (void)
vint32_t counter = 0;
vuint32_t dataValidFlag = 0;
/* initialize pad */
SIU.PCR[ETPUB10_pin].R = (ALT1 | IBE | WPE | WPS) ;
/* Config the SDADC_2 data valid output is input of ETPUB channel 10 */
SIU.SDETPUB.B.CH10 = 1;
/* initialize ICF filter, otherwise input does not pass to the module */
IGF_1.FILTER.MCR.B.FGEN = 1;
/* initialize eTPU hardware */
fs_etpu_init (my_etpu_config, (uint32_t *) etpu_code, sizeof (etpu_code),
(uint32_t *) etpu_globals, sizeof (etpu_globals));
/* initialize eTPU channels */
error_code = fs_etpu_gpio_init (GPIO10_B, FS_ETPU_PRIORITY_MIDDLE);
/* enable all timebases */
/* Init SDADC_2 */
/* waiting for data valid flag is set */
while(((dataValidFlag == 0)))
validDataFlag = SDADC_2.SFR.R & 0x4;
pinstate = util_etpu_gpio_pin_history(GPIO10_B);
May I have something wrong, could you help me to check it?
Thanks and regards,
HI, I have just test it and I think this routing between SDADC and eTPU actually is not implemented.
Only following SDADC related registers are present in the SIU chapter and none of them are connecting 'valid data available' signal. I am checking it with the factory, either the register is missing in the document or the feature is not implemented and it needs to be removed from the documentation.
I will keep you informed.
Thanks you for supporting :smileyhappy:.
Did you check for "Conversion limit detection watchdog" signal? Is it ok?..I have configured this signal to be input of ETPU channel, but the ETPU channel state always be 0, the behavior is the same the "Data valid" signal case.
You are right, this does not work to me as well. I will try to check it with the factory, if there is anything else needed to configure. Currently I don't know the reason. I will return to you as soon as possible.