How do you read the injection channel on the ADC SAR Seq v2.50?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PaDo_1228851
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

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!

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

You can find channel injection in the Cypress stock example project ADC_SAR_Seq_DieTemp_PSoC401 (File->Code Example->P4200).

/odissey1

Project attached

odissey1_0-1611281742956.png

 

 

View solution in original post

0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

You can find channel injection in the Cypress stock example project ADC_SAR_Seq_DieTemp_PSoC401 (File->Code Example->P4200).

/odissey1

Project attached

odissey1_0-1611281742956.png

 

 

0 Likes
PaDo_1228851
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

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;

 

 

0 Likes