XMC1400 boot kit ADC and pwm example

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Sharathembdes
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Hi ,

             I am new to infenion i am using XMC1400 boot kit and using DAVE ide can anyone please provide a code to vary the brightness of the 2 leds using by 2 channel PWM using inbuilt potentiometer.

Thanks in  advance,

Sharath.m

0 Likes
1 Solution
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Sharathembdes ,

At the moment, we do not have any code example to support your application. However, I can help you out with the steps which if followed can help you achieve your application-

1. As mentioned in this document , XMC1400 Boot Kit provides a potentiometer R110 for ease of use and testing of the on-chip analog to digital converter. The potentiometer is connected to the analog input P2.5. The analog output range of the potentiometer is the same the VDDP voltage supplied to the XMC1404 device. 

so you can implement a linear formula with PWM output vs reference voltage(potentiometer) such as-

PWM(measurement)= x + y;

where y=reference PWM when voltage is 0 i.e. potentiometer is at minimum.

2. There should be different condition to control the brightness with the help of duty cycle such as -

when voltage is 0, minimum PWM value.

when voltage is VDDP, maximum PWM value.

and another condition, where the above formula(point1) is implemented.

3. You can read the (connect a ADC after potentiometer) digital value in firmware and then use it in the formula to vary the brightness of the LED.

I hope this helps.

Best Regards,

Aashita

when voltage is VDDP, PWM 

View solution in original post

0 Likes
1 Reply
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @Sharathembdes ,

At the moment, we do not have any code example to support your application. However, I can help you out with the steps which if followed can help you achieve your application-

1. As mentioned in this document , XMC1400 Boot Kit provides a potentiometer R110 for ease of use and testing of the on-chip analog to digital converter. The potentiometer is connected to the analog input P2.5. The analog output range of the potentiometer is the same the VDDP voltage supplied to the XMC1404 device. 

so you can implement a linear formula with PWM output vs reference voltage(potentiometer) such as-

PWM(measurement)= x + y;

where y=reference PWM when voltage is 0 i.e. potentiometer is at minimum.

2. There should be different condition to control the brightness with the help of duty cycle such as -

when voltage is 0, minimum PWM value.

when voltage is VDDP, maximum PWM value.

and another condition, where the above formula(point1) is implemented.

3. You can read the (connect a ADC after potentiometer) digital value in firmware and then use it in the formula to vary the brightness of the LED.

I hope this helps.

Best Regards,

Aashita

when voltage is VDDP, PWM 

0 Likes