Exact match. Not showing close matches.
'[PIC]: Re: PIC as PLC modem - how to output two pr'
|On Sun, Mar 02, 2003 at 01:25:43PM +0100, Wojciech Zabolotny wrote:
> However the main problem is how to generate the square waves with the
> programmable frequency... Can it be done with the CCP module? (I need only
> one edge to be jitter free - all external circuits can be "raising slope
> triggered", so the jitter of the failing edge does not matter at all).
> Could it be done as follows?
> Both CCP work in "compare, set output on match" mode (0x1000).
> After each CCPxIF interrupt, the pin CCPx is reset by software, and the new
> CCPRx value is calculated as follows: (PULSE_LENx - the period of the
> square wave)
> CCPRx = (CCPRx + PULSE_LEN) modulo 0x10000
Probably this method should even be used to generate a symmetric waveform, if
it is possible to change the mode "on the fly".
Just after each interrupt the mode should be chnged from 0x1000 to 0x1001,
and after the next interrupt from 0x1001 to 0x1000.
So single TIMER1 + 2 CCPs should be able to generate two symmetric
waveforms with different frequencies and jitter-free slopes.
(however the interrupt rate will be high).
Is it correct?
Wojciech M. Zabolotny
http://www.ise.pw.edu.pl/~wzab <--> ise.pw.edu.plwzab
http://www.freedos.org Free DOS for free people!
http://www.piclist.com hint: To leave the PICList
More... (looser matching)
- Last day of these posts
- In 2003
, 2004 only
- New search...