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.

Question regarding this PIC16F628 tachometer schematic…

Status
Not open for further replies.

mbu

New Member
Just leaning about PIC’s so my question might be way off base!

**broken link removed**

In the above schematic it appears that the circuit contains a 10 Mhz oscillator. If that is correct, is the reason it is there because the designer felt that the internal oscillator of the PIC16F628 was not adequate?

Now assuming what I stated above is correct, could that oscillator be left out and the PIC16F628 be replaced by perhaps the PIC16F628A, which has to my understanding a 20 Mhz internal oscillator?

Thanks…
 
The schematic indicates a crystal oscillator, so it's probably for accuracy/stability. The internal oscillator of a PIC is very temperature and voltage dependent. In order to determine if the internal oscillator is appropriate for your particular design you need to figure out what frequency the clock would have at it's lowest and highest VCC and temperature points and determine what effect that would have on the tach's output, and if the variation is acceptable. Using a higher frequency internal oscillator is only going to compound the problem even more so. When using the internal RC you're going to want to set it to the lowest possible frequency that still allows you to read the tach input at it's highest frequency components.
 
Both the 628 and 628A have internal 4MHz oscillators. This should be adequate if the incoming frequency is not too high. You could change it for a 16F88 which has a 8MHz int osc.

Mike.
 
Just a note though... There's no current limiting resistors shown on the LED display, this is bad practice especially at 5 volts as it will stress out the PIC's port drivers, and heat the chip some. It's typical to use a transistor on at least the common lines to prevent excessive PIC current draw/heating. That might be why the circuit uses a crystal oscillator.
 
Sceadwian said:
Just a note though... There's no current limiting resistors shown on the LED display, this is bad practice especially at 5 volts as it will stress out the PIC's port drivers, and heat the chip some. It's typical to use a transistor on at least the common lines to prevent excessive PIC current draw/heating. That might be why the circuit uses a crystal oscillator.

Sceadwian,

In your opinion, is the circuit okay the way it is or should I add the transistor? If the transistor is needed, would you tell me what transistor to use and how it should be incorporated into the circuit?

Thanks...

Mike
 
but in that site(josepino.com) people seems to be satisfied with it.they said its working with out any issue.
so is it ok to built as its is,or do u suggest any modifications .
 
The only thing I can suggest without a lot of circuit redesign is placeing a current limiting resistor on the anode lines (1 2 17 and 18) experiment with a few values to determine the lowest brightness level that you find acceptable, probably between 100ohms and 1k. It'll reduce over all power consumtion and avoid any possibility of stress on the I/O lines over time.
As is the circuit will work fine, with a little bit of limiting it'll last a lifetime though.
 
Never seen the code but most likely the LEDs are pulse width modulated directly hence the lack of resistors. There is some PWMing going on indirectly because the LEDs are multiplexed. The internal oscillator is good for all voltage ranges but may change for difference temps. For practical purrposes using a Xtal in todays high quality PICs is a waste of money, board space, and I/O lines.
 
donniedj said:
Never seen the code but most likely the LEDs are pulse width modulated directly hence the lack of resistors.

No, it's just relying on the I/O ports being difficult to damage, they will self limit to a certain extent, so it's not like you're placing the LED's directly across 5V. However, placing current limiting resistors in series with the LED's would be a MUCH nicer way to do it.
 
well i built it on bread board (http://www.josepino.com/pic_projects/index?tachometer2.jpc .but its not working well.mistakes that i felt are
1.i used PIC16f628A instead of PIC16f628
2.may be board connections were loose
3.programmer (its working fine.iam using multi pic prog)
4.iam using this type of 7-segment display(common anode) http://www.neonixie.com/store/images/HP-LED-7-SEGMENT-HDSP-5301.jpg

so i shorted all A's to G's(dp too) together and connected them to the respective ports.and common anode of each segment will connect to the PIC port as per circuit. **broken link removed**

can u help me guys.am i doing right?
 
Maybe this is just me mouthing off, I do not understand why there is no source code. Counting pulses is not rocket science.

Mondo Technology has a circuit called the **broken link removed**. It has 17 functions. One of them is a frequency counter. A frequency counter is pulses per second, a tach is pulses per minute. Should not be difficult to adapt it. He provides source code. It uses a 16F870.
 
Nigel Goodwin said:
It's not really a problem, WinPicProg will disassemble it - he just needs to change the config fuse settings for a 16F628A.

you mean these settings
PIC: 16F628
CONFIG: XT osc, PWRT ON, MCRL OFF, BODEN OFF, WD OFF
 
fever said:
you mean these settings
PIC: 16F628
CONFIG: XT osc, PWRT ON, MCRL OFF, BODEN OFF, WD OFF

Yes, you should be able to just set them in the programmer software as well - but the 628 and 628A use different numeric values for them.
 
when i choose the device as PIC 16f628A and loaded the HEX (which is for 16F628) the software loading same settings.(i tried on picprog4u,ICprog,Winpic etc).imean
PIC: 16F628
CONFIG: XT osc, PWRT ON, MCRL OFF, BODEN OFF, WD OFF

still no use.all the LED's in the display just switching on and staying like that.

iam using code from http://www.josepino.com/pic_projects/index?tachometer2.jpc

and using multi pic programmer v5.2 for programming.
 
You can disassembler the hex file and edit it and compile again with MPLAB. But if you load 628 file into a 628A, I'm not sure whether it is working or not, I use the correct one all the time.
 
at last its working.
its my mistake i built it on breadboard,so usually some loose connections.
circuit is ok.i used 16F628A only with same code.but i don't think w can use it for automotive applications.(i want to used inductive pickup method to measure the RPM).the code is quite sensitive(giving unstable readings)
so any more ideas for this circuit guys.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top