Searching \ for '[PIC]: Generating variable frequency square waves' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Generating variable frequency square waves'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Generating variable frequency square waves'
2000\11\10@131247 by john darcy

picon face
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.

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.




2000\11\10@133822 by Thomas C. Sefranek

face picon face
Hint...

Read about the TIMERS.

john darcy wrote:

{Quote hidden}

--
 *
 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.




2000\11\10@153841 by Dan Michaels

flavicon
face
Anyone,

- related to this issue, I know I can use a couple of
daisy-chained XOR gates to produce a frequency-doubler ckt.

- does anyone good at logic know off-hand if the doubled
output will retain the same duty cycle as the input?

regards,
- danM
=========

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.




2000\11\10@153843 by Dan Michaels

flavicon
face
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:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.




2000\11\10@162002 by Lawrence Glaister

flavicon
face
the xor trick to double the freq results in a waveform that has pulses at
each edge
of the original signal. If you need a square wave out, you could always
quadruple the
signal and feed the result into a flipflop to restore a 50% duty cycle.

=======================================================
Lawrence Glaister VE7IT             email: .....lgKILLspamspam@spam@jfm.bc.ca
1462 Madrona Drive                  http://jfm.bc.ca
Nanoose Bay BC Canada
V9P 9C9
=======================================================
{Original Message removed}

2000\11\10@163427 by M. Adam Davis

flavicon
face
Doubling the signal results in a pulse for every transition of the
original wave:

(view in monospace)
           ________          ________
1: ________|        |________|        |________
           _        _        _        _
2: ________| |______| |______| |______| |______

If you double this, you get two short pulses for every transition of the
original signal.  Put this through a flip flop, and you only achieve
signal number 2.

In order to double, quadruple or multiply a signal and keep a certian duty
cycle you need a PLL, or you need to define your input frequency to be
constant, and use a pulse stretcher to get a 50% duty cycle out of #2.
This has very little use, being a constant.

-Adam


Lawrence Glaister wrote:
{Quote hidden}

> {Original Message removed}

2000\11\10@164920 by Bob Ammerman

picon face
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 removed}

2000\11\11@070757 by mike

flavicon
face
On Fri, 10 Nov 2000 15:38:43 -0500, you wrote:

>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.
If by 'rock steady' you mean zero jitter, you can do this using timer
interrupts, with Fosc/4 resolution.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use .....listservKILLspamspam.....mitvma.mit.edu?bodyT%20PICList%20DIGEST




2000\11\11@123343 by Dan Michaels

flavicon
face
Mike Harrison wrote:

>>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.

>If by 'rock steady' you mean zero jitter, you can do this using timer
>interrupts, with Fosc/4 resolution.
>

By rock-steady, I meant it is generated in h.w., and once set,
doesn't even burp when any other s.w. is running. Just try generating
a 1 Mhz square-wave in s.w. simultaneous with RS-232 comms.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\11\13@135320 by embedded engineer

flavicon
face
Dan Michaels wrote:
>
> Mike Harrison wrote:
>
> >>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.
>
> >If by 'rock steady' you mean zero jitter, you can do this using timer
> >interrupts, with Fosc/4 resolution.
> >
>
> By rock-steady, I meant it is generated in h.w., and once set,
> doesn't even burp when any other s.w. is running. Just try generating
> a 1 Mhz square-wave in s.w. simultaneous with RS-232 comms.

If the extra hardware is not too much, maybe an external phase locked
loop circuit would be in order.

David

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:","[SX]:","[AVR]:" =uP ONLY! "[EE]:","[OT]:" =Other "[BUY]:","[AD]:" =Ads




2000\11\13@141850 by Dan Michaels

flavicon
face
part 1 1370 bytes content-type:text/plain; charset="us-ascii"David-embedded wrote:
{Quote hidden}

Extra h.w. is probably ok for some. Am enclosing the PLL ckt
Jinx sent me offlist - I imagine he won't mind -[am sure it
came out of a book anyways - say what, J ???].

Another 1-chip solution came to mind. A Scenix running at 50
Mhz could probably handle a "finely-tuned" VP [virtual peripheral]
that could both generate two square-waves to 1 Mhz and also perform
RS-232 simultaneously, without burping the square-waves.

- danM


part 2 6771 bytes content-type:image/gif; name="LACLK.GIF"; (decode)


part 3 1 bytes content-type:text/plain; charset="us-ascii"


part 4 228 bytes
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:","[SX]:","[AVR]:" =uP ONLY! "[EE]:","[OT]:" =Other "[BUY]:","[AD]:" =Ads




2000\11\13@160938 by Jinx

face picon face
> Extra h.w. is probably ok for some. Am enclosing the PLL ckt
> Jinx sent me offlist - I imagine he won't mind -[am sure it
> came out of a book anyways - say what, J ???].

It's a section from my first logic analyser, built IIRC from Electronics
Australia plans. Note that f0 - f6 are digital frequency selects, ie
inputs not outputs. I've got the original schematic around here some
where and IIRC it used LPT (so you could dial in a freq with the PC
s/w), whereas I adapted it for a 68HC705C9 and a serial connection.
f0 - f6 in my case were used manually by a 100k pulldown array and
DIP switches to Vcc

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:","[SX]:","[AVR]:" =uP ONLY! "[EE]:","[OT]:" =Other "[BUY]:","[AD]:" =Ads




2000\11\14@060154 by john darcy

picon face
Thanks for all the help guys
--- Dan Michaels <oricomspamspam_OUTUSWEST.NET> wrote:
{Quote hidden}

x-mac-type=47494666; x-mac-creator=4A565752
>


__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...