Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital Pulse Generator and PIC

Status
Not open for further replies.

Barry

New Member
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 **broken link removed**
All comments are appreciated.
Thank you in advance.
Barry.
 
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.
 
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
 
Thanks guys. Will try it out and report back. Must first build the pulse generator. We live and we learn!
Cheers.
 
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
 
Intereating idea and thanks for your input Chris. How would I be able to change the output frequency (variable)?
 
Barry said:
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. :D
-Chris
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top