Hi everyone,
I'm new in the discussion forums, and of course I apologise in advance, in case I don't do it right.
First of all, I'm working with the FRDMKL02Z kit, and nowadays I'm using IAR as development tool.
I want to generate a PWM signal (100 Hz and 10% duty cycle), and I realised that there is a similar freescale example using the TPM module. This freescale example works fine with the preconfigured frequency of 120 Khz, but it does not work fine when the frequency is changed to 100 Hz (in this case a 555 Hz signal is sourced).
These are my questions:
Thanks in advance.
Hello Andree,
1. Yes, it can generate a 100 Hz signal . which freescale example do you mentioned ?
If you install KDS IDE, you can create one PE project ,then you can easily configure the PWM frequency to 100hz :
2. About your this question "acquire a sensor signal only when the previous signal is high", do you want
capture the high signal ? You can use the capture mode of Timer:
You can also use one GPIO input interrupt function. If i misunderstand your meaning , please tell me .
About the synchronize the TPM signal with the ADC , how about in the TPM interrupt start the ADC .
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------