PDA

View Full Version : pulse counter



daydream
- 6th May 2012, 08:03
hi,i use pic16f628a.i used the code below.connected the circuit like the image.i used pin 12 for input.but lcd shows nothing.
can sometell me what is the problem.
thx.

Archangel
- 6th May 2012, 08:40
CMCON = 7 'turn off analog comparators which kill digital on port A
TRISA =%00000000 'all porta as outputs
TrisB.4=0
TrisB.5=0 ' make portb4:5 outputs

daydream
- 6th May 2012, 09:20
thank you archangel.
i will test it and let you know the result.

mister_e
- 6th May 2012, 09:58
In addition to Archangel. From what I know of Isis/Proteus whatever it is called) you
- don't need to add a voltage regulator but some power terminal and assign them to Vdd.
- unless you modify the config fuses, you'll need to tie MCLR to Vdd,

mister_e
- 6th May 2012, 10:27
pretty much it

Ramius
- 6th May 2012, 13:34
Hi Daydream,
I am not sure if your drawing is complete (showing all components) or just simplified and if it is complete then you are missing the filter / anti-oscilation capacitors at the output of the 7805. Typically, at least a 1 uf tantilum capacitor is necessary and it does not hurt to add a .1 uf and then some larger value (greater than 10 uf). If it helps, usually pin 4 (MCLR) is tied to +5v thru a 10k resistor as Mister_e pointed out. Best, Ed

daydream
- 7th May 2012, 11:17
hi,i added the capacitors and the 10 kohm resistor and lcd shows the frequecy.
so thank you all for your help.
could someone change the main loop so that lcd shows freq and Period on the first and second line.
thx.