S12ZVC Sample Code for reading from AN0 ADC0.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S12ZVC Sample Code for reading from AN0 ADC0.

1,102件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

1,062件の閲覧回数
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 件の賞賛
返信

1,090件の閲覧回数
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 件の賞賛
返信

1,049件の閲覧回数
StanoA
NXP TechSupport
NXP TechSupport

Hello Highlander,

I'm glad that all is working well.

Best Regards,

Stano.

0 件の賞賛
返信