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.

PIC 12F629 based logic probe with frequency counter concept.

Status
Not open for further replies.

blueroomelectronics

Well-Known Member
As a cheap & cheerful kit aimed at less than $10 I'd like to build a simple logic probe and frequency counter using the minimal of parts. Of couse the counter will not be accurate beyond the RC calibration of the 16F629 but should give an indication of something running :D

I'll add the caps to the design 10uf & 0.1uf of course.

Opps MCLR & VDD are reversed, I'll fix that too.

Comments?
**broken link removed**
 
Last edited:
Are you the same person who wrote (grin)?
I've never figured out why people use a tiny 8 pin PIC when a larger PIC would do the job better.
Anyway, a couple comments, if I may.

(1) You don't need to tie up a pin to "gate" the counter input. Gate the counter input by changing the pin from an input to an output. Actually, since you're using TMR1 instead of TMR0, you could probably just toggle the TMR1ON bit.
Code:
 ;
        movlw   TRISIO          ; TRISIO register address         |B0
        movwf   FSR             ; setup indirect access           |B0
;
;  perform new 200-msec count
;
        bsf     INDF,GP1        ; T1CKI gate 'on' (input)         |B0
        DelayUS 200000          ; delay 200-msecs                 |B0
        bcf     INDF,GP1        ; T1CKI gate 'off' (output)       |B0
(2) Use a 2-pin Red/Green LED to save another pin. Besides, how do you count Red, Green, and Yellow pulses all at the same time (grin).

Now you have 2 pins left over. What other functions can be added (grin)?
 
A somewhat similar concept can seen at
https://www.phanderson.com/logic_probe.html
It is a bit simpiler on the frequency counter end and includes a clock output. It is $2.49

Kit Description.
This is a very simple kit consisting of only three components that an experimeter may quickly wire on a solderless breadboard to test and debug a design. It allows the experimenter to quickly determine whether a point is at a logic one, zero, open or a pulse train. There is no life threatening steel tip. Rather, the user moves a wire from point to point.
The "probe" circuit consists of a programmed PIC12C508A in an 8-pin DIP, a single 100K resistor and an LED with a built in 330 Ohm resistor. Just three components.
When the probe input is at logic zero, the LED is off. When at a logic one, the LED is full on and when open, the LED is dimly lit.
Positive transitions above 20 pulses per second cause the LED to flash at 10 pulses per second. We have verified operation to 10.0 MHz.
In addition two output leads are provided which may be used as clock sources. These supply nominally 1.0 and 10.0 pulses per second. A 330 Ohm series limiting resistor is recommended to protect the PIC if a clock output is accidentally connected to +5 or to ground is and two 330 Ohm resistors are supplied with the kit. This feature may eliminate the clutter of a 555 which many beginners use as a clock.
Note that the unit may be used as both a probe and a clock at the same time.
 
While Mr. Anderson's kit isn't that impressive in and of itself, his mention of using it for a 555 replacement is very interesting.

I wonder how many different 555 functions you could emulate with an 8 pin PIC? Perhaps use a pot' for frequency, another pot' for duty cycle, a serial interface to actually see what those settings are (hey, why not? you only need 1 pin). A couple jumpers to select the mode; Astable, One-Shot, etc.

I can imagine several uses for it. What do you think guys?

Mike
 
Mike said:
Are you the same person who wrote (grin)?

Anyway, a couple comments, if I may.

(1) You don't need to tie up a pin to "gate" the counter input. Gate the counter input by changing the pin from an input to an output. Actually, since you're using TMR1 instead of TMR0, you could probably just toggle the TMR1ON bit.
Code:
 ;
        movlw   TRISIO          ; TRISIO register address         |B0
        movwf   FSR             ; setup indirect access           |B0
;
;  perform new 200-msec count
;
        bsf     INDF,GP1        ; T1CKI gate 'on' (input)         |B0
        DelayUS 200000          ; delay 200-msecs                 |B0
        bcf     INDF,GP1        ; T1CKI gate 'off' (output)       |B0
(2) Use a 2-pin Red/Green LED to save another pin. Besides, how do you count Red, Green, and Yellow pulses all at the same time (grin).

Now you have 2 pins left over. What other functions can be added (grin)?
The comparator is not to gate TMR1 (it has a special gated mode on the 12F629) it's designed to test for an open circuit at low pulse rates. Changing the VREF D/A over two levels should be an indication of Hi, Low or open.

An open condition would leave all LEDs off, Above 3.0V High LED on, below 1.5V Lo LED on.

The amber LED would be flashing with the other two at frequencies above 10Hz

Ie

500 Hz
Green 5 flashes wait
Red 0 flashes
Amber 1 flash wait (multiplier = 1 zero)

82 Hz
Green 8 flashes wait
Red 2 flashes wait
Amber on solid if >10Hz or <100Hz

3 Hz
Red and Green (oversampled using VREF) will attempt to display true data using the comparator mode
Amber off
 
Last edited:
Hey it's a theory, might not work in practice but that's why I posted it.

Just don't dig up my old MyBlueRoom posts (you'll see stupid)

I'll simulate the design with the 16F88 and debugger.

Now the real question are what should TTL High min and TTL Lo max values be?

I've seen 2.0V and 0.8V (VREF = 0.833 & 2.083V) at 5V or slightly lower because of the 0.7V diode drop. Must calculate...
 
Last edited:
Mike said:
While Mr. Anderson's kit isn't that impressive in and of itself, his mention of using it for a 555 replacement is very interesting.
Mike

Never said I was impressed.

When one sets out to design most anything it is a good idea to look at what is already out there. It does provide the clock outputs and another way to deal with pulses/frequency.

For about ten cents more you can move up to the PIC12F683 with twice the mem, 10 bit ADC, and PWM. Not sure if any of that would come in handy.
 
Mike said:
While Mr. Anderson's kit isn't that impressive in and of itself, his mention of using it for a 555 replacement is very interesting.

I wonder how many different 555 functions you could emulate with an 8 pin PIC? Perhaps use a pot' for frequency, another pot' for duty cycle, a serial interface to actually see what those settings are (hey, why not? you only need 1 pin). A couple jumpers to select the mode; Astable, One-Shot, etc.

I can imagine several uses for it. What do you think guys?

It's a fairly common use for 8 pin PIC's, you can easily use it as a 'super 555'.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top