Hello Jerry,
I presume you are actually using the QY4A chip, since the QY4 does not have a TCLK pin. So you would already have allowed for the extra ADC channels available on Port B, for the A-suffix device. The TCLK pin is input only.
The data sheet states that TCH1 is available as a general purpose I/O pin when MS0B control bit is set., so would be OK to use for things other than a timer function.
Do you actually need to use buffered PWM? If you can change the modulo register value to suit the PWM frequency, and suitably adjust other timing functions that use timer overflow, you might consider unbuffered PWM - operation is much simpler.
Regards,
Mac
You need to set the MS0B bit to enable BUFFERED PWM. When you do, the PTA1(TCH1) pin is not used, and is available to the ADC. The PWM will be outputted on the PTA0(TCH0) pin.It says in the data sheet that for buffered PWM operation, to set the MS0B pin, however, I was wondering if this was necessary to generate the PWM signal since I'm already using the PTA1(TCH1) pin for other things.
If you mean "Can PWM signals be output on the TCLK pin?", the answer is "No". If you mean "Can PWM signals be based on a clock that is input into the TCLK pin?", the answer is "Absolutely".Can PWM signals be generated from the TCLK pin as well . . . ?
Normally, you would not modify the free-running counter, and you can process the TOF normally without disturbing the PWM. They can operate independently if programmed correctly.. . . and will the PWM timer signal mess up just a free-running timing counter that I may have going on as well because of the TOF register?