Maybe use a PWM to generate one clock, and generate the other in code? Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: Dan Michaels To: Sent: Friday, November 10, 2000 3:38 PM Subject: Re: [PIC]: Generating variable frequency square waves > Hi John, > > This is not quite what you are after, but ---- > > Since you are using a '74, if you want "rock-steady" pulsetrain > output, not dependent upon any software, you might also look at > using the PWM modules. You can only get one frequency this way, > but you can get 2 different pulsewidths or duty cycles. > > With 10Mhz xtal, you can get 2.500 Mhz down to 600 hz - it obviously > scales by xtal value. Frequency selections are a little "grainy" > on the high end - 2.5, 1.25, .8333, .625, .500, .4166, .357, .275, > .250, etc. However, rock-steady pulse generation. > > This works because the PWM registers on the PICs are totally > programmable for any pulse width and pulse periods. For more info, > I have an appnote on this: > > "AN-ECD06 - Precision 50-nsec Pulse Generation Using a PIC16C63" > > http://www.users.uswest.net/~oricom/appnotes.htm > > regards, > - Dan Michaels > Oricom Technologies > http://www.users.uswest.net/~oricom > =================================== > > > > > tom sefranek wrote: > >Hint... > > > >Read about the TIMERS. > > > >john darcy wrote: > > > >> Hi, well for a start sorry about my first post...i > >> didn't make things too clear. I checked the archives > >> but couldn't find anything that helped. > >> > >> What I need is some code (pic assembly) for a PC16C74A > >> to implement the following.... > >> > >> **Generate two square wave outputs, each with a 50% > >> duty cycle. Also I want to be able to vary the > >> frequency of these signals independently of one and > >> other from about 1KHz to 2MHz or as close as I can get > >> to these limits. > >> > >> **The frequency of each square wave will be entered on > >> a PC keyboard and sent via the serial port to the PIC > >> but at the moment my main problem is trying to set up > >> the square waves themselves. > >> > >> If anyone has some code that I could use to generate > >> these square waves and set their frequencies by say > >> putting a value in the appropriate register I'd really > >> appreciate it. Thanks a million, > >> John. > >> > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.