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.

Pull My Hair out, Optical Tachometer - PIC16F628A

Status
Not open for further replies.
I'll have to pick up a cap to try. I was able to get the voltages.

PIC Chip pin voltages:

PIN / Voltage
1 / 0v
2 / 5v
3 / 5v
4 / 5v
5 / 0v
8 / 5v
14 / 5v
17 / 0v
18 / 5v

LCD PCB Voltages:

PIN / Voltage
1 / 0v
2 / 5v
3 / .19v
4 / 5v
5 / 0v
6 / 0v
11 / 5v
12 / 0v
13 / 0v
14 / 5v
15 / 3.65v
16 / 0v

I'm also attaching a picture of my breadboard.
i downloaded and simulated the set up, less the sensor aspect.
it really showed black boxes 8 numbers in 1st row nothing on 2nd
when i analyzed the mach.bas file, i find no reference to setting LCD or lcd related .bas include file.
how shall we expect any thing from this?
i am , of course no expert in basic,
of course it compiled with no errors, doesn't perhaps mean it would work what we feel. Even the hex file too did not work
please confirm again , whether you saw the text as described, ever displayed?( not on simulator please)
 
Last edited:
i downloaded and simulated the set up, less the sensor aspect.
it really showed black boxes 8 numbers in 1st row nothing on 2nd
when i analyzed the mach.bas file, i find no reference to setting LCD or lcd related .bas include file.
how shall we expect any thing from this?
i am , of course no expert in basic,
of course it compiled with no errors, doesn't perhaps mean it would work what we feel. Even the hex file too did not work
please confirm again , whether you saw the text as described, ever displayed?( not on simulator please)

hi Sarma,
The LCD data line 11 thru 14 voltages look incorrect, as you say it appears the LCD has not been initialised.
I will also run the downloaded *.hex in Oshonsoft,, do you have the original source code.?

Eric
 
hi Dustin,
Ran the TACH.hex file with the Oshonsoft Simulator, got these images.

I used Nigels WinPic to disassemble the hex into TACH2.asm

It appears that the LCD is being initialised OK.

AAesp05..gif
 

Attachments

  • TACH2..asm
    9.9 KB · Views: 234
hi Sarma,
The LCD data line 11 thru 14 voltages look incorrect, as you say it appears the LCD has not been initialised.
I will also run the downloaded *.hex in Oshonsoft,, do you have the original source code.?

Eric
Hi Eric,
I ran the hex
I only changed the pin3 connection of LCD, with a diode and / or a 10 Ohm resistor to ground, instead of direct ground.
thought twice it did not show up, after programming a 3rd time it started working.
the original .bas file is there at bottom of the link referred by O P.
I was not into Basic, I doubted , without LCD definition lines, it would not show up. But on the contrary it worked!!
link for the tach.bas file
**broken link removed**
 
Last edited:
hi Dustin,
Converted the original Basic to Oshonsoft Basic, added the LCD initialise routines.
Works ok.

NOTE: change the Tacho2.txt to Tacho2.hex, I cannot upload a hex file directly.

Program your 16F628A with this hex file , lets know.:)
 

Attachments

  • Tacho2..bas
    1.5 KB · Views: 280
  • Tacho2..txt
    2.4 KB · Views: 241
hi Dustin,
Converted the original Basic to Oshonsoft Basic, added the LCD initialise routines.
Works ok.

NOTE: change the Tacho2.txt to Tacho2.hex, I cannot upload a hex file directly.

Program your 16F628A with this hex file , lets know.:)
incidentally as the schematic has a 4k7 resistor n MCLR, perhaps it would be better to have MCLR ON
further programming with cheap programmers wont become an issue wanting Vpp before Vdd.
 
I will try the new hex file, but it would be strange for it to work with this one. The original hex was working when the PIC circuit was isolated as it shows on the tachometer webpage.

I will also try going straight to 5v on MCLR.

Thanks for looking into this, I appreciate the help.
 
I will try the new hex file, but it would be strange for it to work with this one. The original hex was working when the PIC circuit was isolated as it shows on the tachometer webpage.

I will also try going straight to 5v on MCLR.

Thanks for looking into this, I appreciate the help.

hi,
With my hex file dont remove the 4k7 to MCLR and directly connect to +5V, as its now set a digital I/O pin.
Leave the 4k7 in situ.
 
Ericgibbs, you had mentioned the voltages did not seem correct? Were you thinking this could be due to the programming or is there something else it could be? What would the voltages on pins 11-14 typically be?
 
hi Dustin
Checking Sarma's post, the 4k7 is not on MCLR its on RA4, which the RS control to the LCD.!

incidentally as the schematic has a 4k7 resistor n MCLR, perhaps it would be better to have MCLR ON
further programming with cheap programmers wont become an issue wanting Vpp before Vdd.

EDIT:
If you need to add a manual reset push button, useful for debugging use this hex file and add the 'red' components.

TACHa..gif
View attachment Tacho2_1..txt
 
Last edited:
So that could be the problem, having a resistor going from +5v to pin 4 on the lcd and pin 3 on the pic? I noticed on the voltages I listed I was still getting +5v on those pins even with the resistor.
 
i correct myself that there was no resistor on MCLR pin.
Incidentally, keeping ground on display pin 3 won't serve contrast adjustment issue?
 
i correct myself that there was no resistor on MCLR pin.
Incidentally, keeping ground on display pin 3 won't serve contrast adjustment issue?

hi Sarma,
I believe the OP has already connected a contrast pot.??
 
hi Sarma,
I believe the OP has already connected a contrast pot.??

Yes, there is a small 10k pot between pin 3 and ground. I'm trying to get my girlfriend to e-mail me a picture of my breadboard viewing straight down so you can see how I have it setup better.

I will add the debug switch and verify the connections in your diagram tonight. I take it if it doesn't do anything I hit the momentary switch to reset and see if it does anything then?
 
Yes, there is a small 10k pot between pin 3 and ground. I'm trying to get my girlfriend to e-mail me a picture of my breadboard viewing straight down so you can see how I have it setup better.

I will add the debug switch and verify the connections in your diagram tonight. I take it if it doesn't do anything I hit the momentary switch to reset and see if it does anything then?
can you imagine what I did, i had a display with berg male connector
plugged on to breadboard and jumper straight to PIC.
generally i locate that area only for lcd
 
hi Dustin
Checking Sarma's post, the 4k7 is not on MCLR its on RA4, which the RS control to the LCD.!



EDIT:
If you need to add a manual reset push button, useful for debugging use this hex file and add the 'red' components.

View attachment 40587
View attachment 40588
Your schematic has shown the green wire direct to ground !! btw , how do you manage to post image or text file?
perhaps using your web or blog?
 
You have to go to the reply page, not the quick reply box. Then down a bit you will see "manage attachments", click that. A box will open up, click "add files". Select and upload your files. Then you check the box next to the file you want to attach and add it to the reply.
 
You have to go to the reply page, not the quick reply box. Then down a bit you will see "manage attachments", click that. A box will open up, click "add files". Select and upload your files. Then you check the box next to the file you want to attach and add it to the reply.

hi Dustin.
On that that 10K pot, one end is connected to 0V and the other end to +5V , with the wiper connected to the contrast pin for it to work correctly. Adjust the pot until you can just see the black blocks.
 
You have to go to the reply page, not the quick reply box. Then down a bit you will see "manage attachments", click that. A box will open up, click "add files". Select and upload your files. Then you check the box next to the file you want to attach and add it to the reply.
i was doing the same earlier
but of late my pc seems not supportive.. thanks let me try again
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top