Menu

is pic16f676 dead?

Help
2012-08-06
2021-04-27
  • Nobody/Anonymous

    hi all,
    i  made a "voltmeter" circuit for 16f676 and tried to program it for a 3 digit 7 segment common anode display.  i used gcbide to program it.
    the result was strange and flickering  display at first, then all segments gone high as "8.8.8." including decimal points.
    then i erased the program from pic and all displays gone low
    i know i am not good at electronics, maybe i killed the pic. how i can be sure about that?, please help me.
    here is the shematic:

     
  • Nobody/Anonymous

    Nice to see a real schematic show up on the forums, very nice!

    A couple of things stand out here:

    1)  The inbuilt library is for a common cathode display, so unless you have accounted for that in code, the 8.8.8. is what you would expect on startup (i.e. the ports are cleared on initialization).  The easiest way to do this without messing with the 7segment.h library would be to re-initialize the ports to display ports/segments to 1's

    PortC = 255
    Set PortA.1 ON
    Set PortA.2 On
    

    Then be sure to invert the display digit numbers before sending them to DisplayValue display ,data.  One way would be to:

    volts = 127 - volts  'This gives binary opposite
    DisplayValue 1, volts
    

    2)  It would do well to keep the voltage divider input off the ICSPDAT line, same goes for the  ICSPCLK line.  It could be interfering with programming.

    If more than 5.5-6V was allowed in on the voltage divider, then an individual pin could be blown.  Check by trying a blinky led on this line to be sure it works.  If the chip is warm or hot (at a low load) could also signal the chips demise.

    I just happened to do this very same project and by luck I had a common cathode display, and an 18 pin device that can dedicate a PORT to the segments, good luck.

     
  • Nobody/Anonymous

    thanks for the reply,
    i found the problem: power suply , which is just simple unregulated 9v adapter. 

    then i got better power suply but there were negative digits at first  as you warned (for ex.: "E" for "1")

    finally i got correct digits by editing 7segment.h file.

    now, time to calibrate,
    thank you again

     
  • Nobody/Anonymous

    by the way finally i burned the chip by short circuit on 7805 :(
    anyway, i want to publish source code and common anode .h files:
    http://dl.dropbox.com/u/26934738/pic16f676voltmeter.zip

    notes:
    *the source needs to edit for calibration. (short circuit destroyed my chip because i tried 25V for calibration)
    *the 7segmentCA.h file edited by me for numerals only. you can change alphanumeric display values by this formula:
    CA value=255-CC value (for ex. 199 =A for CC then 255-119=136 for CA)
    *you have to rename 7segmentCA.h to 7segment.h before compiling (don't forget to back up original one)

     
  • RAJEEV

    RAJEEV - 2021-04-25

    Hello All,
    Please help me to build a volt meter using pic micro controller

     
  • William Roth

    William Roth - 2021-04-27

    What kind of help do you need?
    What problems hare you having?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.