S12ZVC Sample Code for reading from AN0 ADC0.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12ZVC Sample Code for reading from AN0 ADC0.

1,070 Views
highlander
Contributor II

Hello,

 

Are there any sample projects to read the ADC0 on the reference board? I have added AD1 through Processor Expert with the following settings.

https://prnt.sc/12deqnj

 

This is the code I've written to try to read it but I am unable to make it work.

void doAVI(void)
{
word R_AVI1;
AD1_GetValue16(&R_AVI1);
FRP = R_AVI1;
}

 

Any help would be hugely appreciated.

0 Kudos
Reply
3 Replies

1,030 Views
highlander
Contributor II

Thanks for your response. Truly.

for now PE works. I had not found that Quick Start Guide code. I wonder if there is one as well for the s12xe development board.
The main issue I had here was my placement of the AD1_Measure() routine. For unknown reasons where I was placing this call it was not transferring the variable to my local variable to further the calculation needed with the ADC.

Luckily I found a blog by Eric Styger that has been a godsend.

 

I am sorry for the amateur/rookie questions. I am learning this and its a steep hill to climb.

Thanks for your patience and answers.

Chris

0 Kudos
Reply

1,058 Views
StanoA
NXP TechSupport
NXP TechSupport

Hello Highlander,

I want to suggest you to build your application without PE engine, because it is not supported for long time . The common C-code build brings  you more visibility and more variability to your code. Attached is the example code (*.zip file) for ADC measurement. You can access next more examples for this MCU on web:

https://www.nxp.com/downloads/en/lab-test-software/DEVKIT-S12ZVC-LAB.zip

or whole quick start package on:

https://www.nxp.com/webapp/Download?colCode=DEVKIT-S12ZVC-QSP

It contains comprehensive guide to work with this MCU.

I wish you many success in you project.

Best Regards,

Stano.

 

0 Kudos
Reply

1,017 Views
StanoA
NXP TechSupport
NXP TechSupport

Hello Highlander,

I'm glad that all is working well.

Best Regards,

Stano.

0 Kudos
Reply