- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the ADC SAR set up for channel 0 and the INJ channel.
I can read channel 0 fine with this code:
ADC_StartConvert();
ADC_IsEndConversion( ADC_WAIT_FOR_RESULT );
data = ADC_GetResult16( 0 );
But the following doesn't work for the Injection Channel:
ADC_StartConvert();
ADC_EnableInjection();
ADC_IsEndConversion( ADC_WAIT_FOR_RESULT_INJECT );
data = ADC_GetResult16( ADC_SAR_INJ_RESULT_REG );
I can't find example code anywhere. What am I doing wrong? Thanks!
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can find channel injection in the Cypress stock example project ADC_SAR_Seq_DieTemp_PSoC401 (File->Code Example->P4200).
/odissey1
Project attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This code also worked for me:
ADC_SAR_SEQ_EnableInjection();
ADC_SAR_SEQ_StartConvert();
ADC_SAR_SEQ_IsEndConversion( ADS_SAR_SEQ_WAIT_FOR_RESULT_INJ );
uint16 data = ADC_SAR_INJ_RESULT_REG;