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.
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.
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
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.
Hello Highlander,
I'm glad that all is working well.
Best Regards,
Stano.