Read the value of Potentiometer and print the value .

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

Read the value of Potentiometer and print the value .

786 Views
chandanmohanty
Contributor I

I am new to nxp s32k144 . I have successfully tested the read and write functions but now i want to use ADC module and write code for reading the value from potentiometer and then displaying it on semihosting console . 
please provide me the code and also give me step by step instructions to run that code and view the output also give me the photos of the step by step process

#potentiometer #s32k144 #nxp

 

0 Kudos
Reply
6 Replies

763 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @chandanmohanty 

Check the ADC - SW Trigger example provided in the S32K1xx Series Cookbook. In this example, the ADC is initialized to convert two channels using software triggers. One channel connects to
the potentiometer on the S32K144 evaluation board and the other to VREFSH. 

Regarding displaying data in the semihosting console. This can be done by using the printf function. Check the following community post. It has information related to the topic you might find useful. 

Printf in S32DS

 

B.R.

VaneB

0 Kudos
Reply

756 Views
chandanmohanty
Contributor I

Hi @VaneB ,

I appreciate your response , but for displaying the value of potentiometer i.e if i vary the potentiometer the changing value should printed .
The code in the cookbook for sw trigger is not for arm i guess . 
I want to write the code for ADC potentiometer using header files such as :
#include "pin_mux.h"
#include "adConv1.h"
#include "clockMan1.h".

Regards ,
Chandan 

0 Kudos
Reply

742 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @chandanmohanty 

Could you confirm if the software is the S32 Software Development Kit for S32K1? If yes, this also comes with some ADC examples that read the EVB potentiometer value, and when the conversion is complete the data is sent to the host PC using LPUART.

0 Kudos
Reply

725 Views
chandanmohanty
Contributor I
Also if there is no other way to print the value like printf function then give me the steps to run the uart example thoroughly .
0 Kudos
Reply

722 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @chandanmohanty 

As I previously said, displaying data in the semihosting console can be done by using the printf function. Check the following community post. It has information related to the topic you might find useful. 

Printf in S32DS

0 Kudos
Reply

728 Views
chandanmohanty
Contributor I
yes I use this SDK . Can I have the code without using LPUART .
0 Kudos
Reply