1. 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.
    Dismiss Notice

Pull My Hair out, Optical Tachometer - PIC16F628A

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by DustinB, Mar 22, 2010.

  1. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Will do. Going to rebuild the circuit on a pcb using the bus wire I'm getting tonight. I'll include a .1uF metalized poly film cap between the +5/gnd on the pic(pins 5 & 14). I'll also replace the wires as stated on the LCD just to make sure everything is up to par. Then I'll try the suggested hex file.

    I'll update with my results. Thanks again.
     
  2. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    i am keenly watching your efforts DustinB for a positive result
    the software is OK as I watch it
    btw if you have any other LCD, why not try out? or if you have any appliance where 16*2 display can be tested , do it

    btw, suppose you turn the pot , is the contrast changing from dark black to 5*7 lighter dots and then becomes white?

    As you have many colors, try to use resistor color code for pires according to pin number , like black for 1, red for 2 etc. from 10 on repeat them
    it would help you trace the wire easily!!
     
    Last edited: Mar 24, 2010
  3. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    I have another lcd that will be here tomorrow, figured I would want to do something else after this works anyway.

    Yes, you can see the contrast change all the white til it's not visible.

    I'm getting a 3 color set of wire today and some small labels for now. Going to try and find a 10 color set of wire later on. Next time I will probably design the header connectors in order, such as, GND, R7,R6,R5-R0,+. I've also been reading the EPE pdf files on LCDs to better understand exactly how they work. I don't just want this to work, I want to end up knowing "why" this won't work.

    We'll see how it goes.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.

    I like your approach
    i always said a serius learner will learn more due to non working rather than what ever he rigs up works nothing to learn, in the early stages of learning
    later on you gain experience and designs would obviously work
    even discovery failures have been lessons for experts.
    but make it fast and don't leave it.
     
  6. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Well I got it all setup at the top of the breadboard correctly with the new wires on the lcd. The decoupler caps got rid of the pulsing. However, the lcd is still showing solid black squares.

    I know the pic is transmitting data running the dustin1.hex file because the 4 data pins on the lcd are all changing voltage. I'm thinking I may have killed the lcd somehow.

    Either way, I'll have another lcd tomorrow to test again with. If that doesn't work then I will try to build a basic pic circuit on a pcb to see if I can get the lcd working. If that option works I will go ahead and build the tachometer pcb.

    :rolleyes:
     
    Last edited: Mar 24, 2010
  7. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    try to improve on the pcb by making the LCD side termination 1:1 wrt LCD pins. then perhaps you can have straight wiring
    i shall try to up load a new pcb artwork made with eagle that I use.
     

    Attached Files:

    Last edited: Mar 25, 2010
  8. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Thank you for posting that Sarma. I'll have to wait on my etching supplies to come in to make this PCB due to the traces going between pins.

    This weekend I did however build a basic board with bus wire for just the 7805, pic, resistors, decoupling caps, and header pins. I kept the pins lined up in order. I am still getting the solid black boxes on the top row, even with the 10k pot for contrast adjust. I really don't know what is going on, it does it with both LCD screens so I know one isn't bad. The data pins are still seeing voltage changes so I know the pic is transmitting data. The only thing I can guess is the programming is wrong for the setup. Same pin assignments as I have been using. I guess I'm going to have to try and learn some ASM to see if I can get this thing to work. I don't get it, it should work.
     
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi Dustin,
    I have increased the LCD delays in this DustinLED1.hex program.

    Also PORTB.7 will flash an LED if the PIC is running OK.
    Connect a 300R [approx] resistor from the PORTB.7 pin to an LED, so that the pin drives the LED.
    It should flash at about 0.5Sec rate.

    Let me know.:)
     

    Attached Files:

  10. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Hi Eric, I will test it tonight and report back. I've got some 270R matched to some red LED's that I have. Could you upload the basic/asm file, whichever you use? In case it doesn't work I could try some small edits to see if there's any effect. I have an extensive background in programming, just not ASM or basic, I'm sure I could figure it out though.

    Thanks!
     
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    Oshonsoft Basic file.
     

    Attached Files:

  12. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    I have now made newer version with 2 jumpers and no traces in between pins
    if you need it, i can upload it
     
  13. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Sure, thanks Sarma.
     
  14. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    Please see these new ones
    should be easy to make
     

    Attached Files:

  15. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    They look good. What is the switch S1 used for? I will try this layout as soon as I get this LCD figured out, hopefully this week.

    Thanks again.
     
  16. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    please see the schematic of PIC at the link you provided. There, it is named as "MEMORY SWITCH"

    Homemade Optical Tachometer
     
  17. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    Hey Eric, I tested the program last night and still no luck. The LED was blinking though. When testing voltages something weird did happen though. I looked down and noticed the screen was initialized. I was finally able to turn it off and reproduce it. When touching the RS pin with the positive meter probe, with the negative probe not touching anything, the screen will initialize and be blank.

    This is crazy, the chip works, everything seems to be hooked up right, LCD will initialize with a little positive voltage on RS from the meter probe. Yet it still doesn't display. I've tried several different schematics, verified all connections, and still nothing but trouble. This really can't be that hard. :mad:
     
  18. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi dustin,
    Dont go mad just yet.:)
    The RS pin is connected to PIC pin PORTA.4 which is an open drain [ no internal resistor] thats why the 4.7K is connected to it and the other end of the 4.7K to +5V.
    Try reducing the 4K to say about 2.2K.

    The effect with a long meter wire is to be expected.???

    Are you saying when its initialised you can see characters on the display.
     
  19. DustinB

    DustinB New Member

    Joined:
    Mar 22, 2010
    Messages:
    70
    Likes:
    0
    Location:
    Houston, TX USA
    No, still no characters. The screen just initializes and goes blank. You can adjust contrast to be sure it's still displaying. At one point I was touching some other pins randomly and actually got some oddball characters to display IE: ($&%_@*). I think this was from the meter seeing the different signals as binary display input.
     
  20. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    It sounds as though you have an hardware wiring problem on the board to the LCD.?

    As you can see the Basic program could not be simpler, as you can see the LED is flasing about 0.5sec so the program is running OK.

    Are you using the project board or the PCB for these tests.?


    EDIT:
    The 4.7K on this picture shows it going to 0V not +5V

    AAesp10..gif
     
    Last edited: Mar 30, 2010
  21. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi dustin,
    Did you see my EDIT regarding the RA4, pin #3, its connected to 0V not +5V.
     

Share This Page