how to measure pwm without ADC?

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

how to measure pwm without ADC?

629 Views
esam_me
Contributor II

I was wondering if it's possible to use a pin (which is not ADC) to measure pwm i.e battery voltage. If it's possible, how?

My board is lpc1114/302 and this pin is PIO1_5, which has the function of "capture input", my instinct tells me it has to do with what I need!

0 Kudos
1 Reply

570 Views
nxf63973
NXP Employee
NXP Employee

Hi Elmaghrabi Mansour

 

The MCU has two 32-bit counter/timer and each of these has one 32-bit capture channel that can take a snapshot of the timer value when an input signal transitions. One of the capture input applications is as a pulse width demodulator.

 

The Capture Control Register (TMR32BnCCR) is used to enable the load of the Capture Register (TMR32BnCR0) with the Timer Counter when a capture event occurs. The capture event can be a rising edge and/or a falling edge in the Capture Signal pin (CT32Bn_CAP0). Also, the Capture Control Register can enable an interrupt generation when the Capture Register is loaded. Chapter 20: 32-bit counter/timer CT32B0/1 of the LPC111x/LPC11Cxx User manual has more detailed information about this module.

 

Please tell me if you need any more information.

Regards

Jose

0 Kudos