Update Potentiometer value in run time

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

Update Potentiometer value in run time

980 Views
huda_abdalla
Contributor I

I'm using S32K144 evaluation board and trying to use the potentiometer (ADC0_SE12)to change the light intensity of LED.My problem is how I can update the potentiometer value in run time and see an immediate change of the light intensity?

Tags (3)
0 Kudos
5 Replies

116 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 . 
If possible please provide me the code and also give me step by step instructions to run that code and view the output 

0 Kudos

890 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

unfortunately this feature is not supported by S32DS. In runtime you can only see values in PE Micro Real Time Expressions: 

pastedImage_1.png

You can use FreeMaster for that. There is an example in S32DS:

pastedImage_1.png

Jiri

0 Kudos

890 Views
huda_abdalla
Contributor I

Thank you for fast reply,Unfortunately "ftm_pwm_s32k144" is not useful ,since I'm not using SDK. Actually I want to acquire the potentiometer value to ADC and generate PWM to change the RGB light intensity?...I used 

PE Micro Real Time Expressions,if I changed the potentiometer and I have to run the code every time so that I can see the value changing also the intensity..What I need is to see the intensity changing with potentiometer changing without the need to run the code each time !!  

I hope it is clear

0 Kudos

890 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

sorry, I don't get it. If I understand it correctly - you like to simulate potentiometer output voltage by Debugger in real time, Am I correct? 

PE Micro allows only reading values in real time. Value can't be written in real time (you need to stop program, change value, and run it again). 

Jiri

0 Kudos

890 Views
huda_abdalla
Contributor I

yes that's right,I get it now ....I have another question :I would like to update the pwm compare register from the ADC0  to control the the duty cycle of the pwm using the adc,,I'm using FTM0_ch0 for the pwm output

0 Kudos