Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 9th March 2004, 10:14 PM   (permalink)
Experienced Member
Barry is on a distinguished road
Default Digital Pulse Generator and PIC

Hello all,
How do I connect a digital pulse generator to a PIC? The PIC is programmed to count pulses before triggering an event. It is a bit tedious to sit and keep pressing a switch all the time!
The pulse generator has two outputs. The pulse generator circuit was found at http://braincambre500.freeservers.com/dpg.htm
All comments are appreciated.
Thank you in advance.
Barry.
Barry is offline   Reply With Quote
Old 10th March 2004, 02:59 AM   (permalink)
Experienced Member
crust has a spectacular aura about
Default

You would set the pulse generator to whatever frequency you need and the voltage to 0->Vcc. Then you can just directly connect it to your input pin, though I would suggest you connect it through a 1K resistor, just in case your PIC firmware accidentally drives the pin.
crust is offline   Reply With Quote
Old 10th March 2004, 02:09 PM   (permalink)
Experienced Member
 
ivancho is on a distinguished road
Default

You have 2 leads because one is ground. YOu must share ground with your PIC circuit for the Pulse generator to work with your PIC.

Good Luck

Ivancho
ivancho is offline   Reply With Quote
Old 10th March 2004, 07:13 PM   (permalink)
Experienced Member
Barry is on a distinguished road
Default

Thanks guys. Will try it out and report back. Must first build the pulse generator. We live and we learn!
Cheers.
Barry is offline   Reply With Quote
Old 10th March 2004, 10:46 PM   (permalink)
New Member
ChrisBennet is on a distinguished road
Default

You can make a pulse generator with another PIC. A PIC 12F675 for example has an internal clock so your pulse generator could be very simple - the PIC plus the previously mentioned resistor on the output pin.
How cool is that?
-Chris
ChrisBennet is offline   Reply With Quote
Old 11th March 2004, 05:59 PM   (permalink)
Experienced Member
Barry is on a distinguished road
Default

Intereating idea and thanks for your input Chris. How would I be able to change the output frequency (variable)?
Barry is offline   Reply With Quote
Old 11th March 2004, 06:25 PM   (permalink)
New Member
ChrisBennet is on a distinguished road
Default

Quote:
Originally Posted by Barry
Intereating idea and thanks for your input Chris. How would I be able to change the output frequency (variable)?
Without adding more components you wouldn't be able to change the frequency. The pulse generator I spoke of consists of a loop that toggles the state of a pin, calls a delay routine, and then repeats. The delay has a fixed period. (You can use different delays for "signal high" delay, and "signal low" delay to control the shape of the square wave.)

To change the delay period/count externally you could use a potentiometer and one of the pins as an A/D input to get a number you could use to calculate your delay period. Of course that would double the number of components in your circuit to 2.
-Chris
ChrisBennet is offline   Reply With Quote
Old 11th March 2004, 06:58 PM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by ChrisBennet
. Of course that would double the number of components in your circuit to 2.
Now it's getting far too complicated :!:

:P
Nigel Goodwin is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 05:37 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.