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

Help to convert to Anode Display for a 50 V DC Panel Meter...

Discussion in 'Microcontrollers' started by manoj soorya, May 16, 2017.

  1. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    If the last digit is the single digit used to display "A" or "V", I haven't looked at that part of the circuit yet as it's entirely taken care of in hardware.
     
    Last edited: May 20, 2017
  2. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    I am Talking about the 3rd digit. we have 3 digit. like 22.3 volt and 2 is on first digit, 2 is on 2nd digit and 3 is on last digit. I am talking about the last Digit.

    It can also use as single as Volt meter only... need to connect 10K resister from PIN 4 and VCC.

    Regards Manoj
     
    Last edited: May 20, 2017
  3. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    Thanks Mosaic...


    Here are the all file I attached with... Proteus simulation is working 100% Ok.. But in Real hardware its shows error when displaying the voltage...


    Thank you for your Interest in this post....
     

    Attached Files:

  4. dave

    Dave New Member

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


     
  5. Mosaic

    Mosaic Well-Known Member

    Joined:
    Jun 3, 2010
    Messages:
    2,569
    Likes:
    128
    Location:
    Caribbean

    Could be something in the circuit. Can u verify that the segments are working ok by applying voltage direct to them, out of circuit?
    say 5V via a 220ohm to 330 ohm dropping resistr?
     
  6. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    I dont use resistor in common cathod display, but its working correctly.

    I also test without resisitor in common anode display circuit. all segment of the digit directly connected to the corresponding pins of the 16F676.

    OK, I will try with resisitor in common anode display and inform you...

    Thank you Mosaic
     
  7. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    I make the circuit with 220 OHM Resistor. But its showing error in last digit segments....

    regards Manoj
     
  8. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    what kind of error?
     
  9. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    I will upload a video to youtube of the problem.

    Also give you the link....
     
  10. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    I just Upload the video on youtube...

    and this is the link... Please check



    Regards Manoj
     
  11. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Ahhh... Very interesting... I wonder if that could be a RMW (Read/Modify/Write) problem?

    Could you test it again after making the following changes in the source code, please?

    Code (text):
    sel_LSD
            movlw   b'00000000'     ; K3/DP (RC2) pin 'output'        |b0
            movwf   INDF            ; trisc = '00000000' RC2 output   |b0
            movlw   b'00100111'     ; PORTC shadow | 1<<RC2           |b0 <--
            movwf   PORTC           ; active hi DIGIT_3 (RC2) 'on'    |b0 <--
    ;       bsf     DIGIT_3         ; active hi DIGIT_3 (RC2) 'on'    |b0 <--
            btfss   INDEX,0         ;
            goto    fire_LSD_A      ;
    fire_LSD_C
            movf    D3,W            ; digit 3, 0..9                   |b0
            call    LEDTABLE_C      ; get segments D/E/F              |b0
            xorlw   b'00100111'     ; PORTC shadow ^ segments D/E/F   |b0 <--
            movwf   PORTC           ; clr the active D/E/F segments   |b0 <--
    ;       xorwf   PORTC,F         ; clr active lo D/E/F segments    |b0 <--
            goto    display_end     ;
    fire_LSD_A                      ;
            movf    D3,W            ; digit 3, 0..9                   |b0
            call    LEDTABLE_A      ; get segments G/C/B/A            |b0
            xorwf   PORTA,F         ; clr active lo G/C/B/A segments  |b0
            goto    display_end     ;

    sel_CSD
            movlw   b'00101011'     ; PORTC shadow | 1<<RC3           |b0 <--
            movwf   PORTC           ; active hi DIGIT_2 (RC3) 'on'    |b0 <--
    ;       bsf     DIGIT_2         ; active hi DIGIT_2 (RC3) 'on'    |b0 <--
            btfss   INDEX,0         ;
            goto    fire_CSD_A      ;
    fire_CSD_C                      ;
            movf    D2,W            ; digit 2, 0..9                   |b0
            call    LEDTABLE_C      ; get segments D/E/F              |b0
            xorlw   b'00101011'     ; PORTC shadow ^ segments D/E/F   |b0 <--
            movwf   PORTC           ; clr the active D/E/F segments   |b0 <--
    ;       xorwf   PORTC,F         ; clr active lo D/E/F segments    |b0 <--
            btfsc   mode            ; dec pt? no, skip, else          |b0
            bcf     INDF,2          ; trisc = '00000000' RC2 output   |b0
            goto    display_end     ; branch (finish up)
    fire_CSD_A
            movf    D2,W            ; digit 2, 0..9                   |b0
            call    LEDTABLE_A      ; get segments G/C/B/A            |b0
            xorwf   PORTA,F         ; clr active lo G/C/B/A segments  |b0
            goto    display_end     ;
    ;
    sel_MSD
            movlw   b'00110011'     ; PORTC shadow | 1<<RC4           |b0 <--
            movwf   PORTC           ; active hi DIGIT_1 (RC4) 'on'    |b0 <--
    ;       bsf     DIGIT_1         ; active hi DIGIT_1 (RC4) 'on'    |b0 <--
            btfss   INDEX,0         ;
            goto    fire_MSD_A      ;
    fire_MSD_C                      ;
            movf    D1,W            ; digit 1, 0..9                   |b0
            call    LEDTABLE_C      ; get segments D/E/F              |b0
            xorlw   b'00110011'     ; PORTC shadow ^ segments D/E/F   |b0 <--
            movwf   PORTC           ; clr the active D/E/F segments   |b0 <--
    ;       xorwf   PORTC,F         ; clr active lo D/E/F segments    |b0 <--
            btfss   mode            ; dec pt? no, skip, else          |b0
            bcf     INDF,2          ; trisc = '00000000' RC2 output   |b0
            goto    display_end     ;
    fire_MSD_A
            movf    D1,W            ; digit 1, 0..9                   |b0
            call    LEDTABLE_A      ; get segments G/C/B/A            |b0
            xorwf   PORTA,F         ; clr active lo G/C/B/A segments  |b0

    display_end
            incf    INDEX,F         ; bump index 0..5 -> 1..6
            retlw   0               ;
     
    Last edited: May 21, 2017
    • Like Like x 1
  12. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India


    Great Mike... Its working 100% OK.. Chears...

    Thank you So much...
     
  13. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    You're welcome... Have fun...
     
  14. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Hi Manoj:

    May I ask if you know how you hook up that circuit for current measurement, please?

    Thank you. Cheerful regards, Mike
     
  15. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India

    Hello Mike...

    Actually I got this circuit from a Russian Site... And I dont use the Current Measurement Side of this Meter. If you want more about this circuit, I give you the actual link...Its has more explanation...

    http://cxema.my1.ru/publ/instrument...vaemyj_ampervoltmetr_na_pic16f676/47-1-0-5583

    and Mike, One more thing, how can we avoid or disable the first digit 'Zero' when showing 01.2 volt to 09.9 Volt range.. is it Possible? It will show good look of the meter. I just ask you, You can try when your free time....

    Again thank you for your attension ant Help on this post, Mike.... Chears...

    Regards
     
    • Like Like x 1
  16. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Thank you for the link, Manoj.

    To suppress a "leading zero", try inserting two new lines of code as shown below;

    Code (asm):
    fire_MSD_C                      ;
            movf    D1,W            ; digit 1, 0..9                   |b0
            bz      display_end     ; suppress a leading zero         |b0 <-- insert
            call    LEDTABLE_C      ; get segments D/E/F              |b0
            xorlw   b'00110011'     ; PORTC shadow ^ segments D/E/F   |b0 <--
            movwf   PORTC           ; clr the active D/E/F segments   |b0 <--
    ;       xorwf   PORTC,F         ; clr active lo D/E/F segments    |b0 <--
            btfss   mode            ; dec pt? no, skip, else          |b0
            bcf     INDF,2          ; trisc = '00000000' RC2 output   |b0
            goto    display_end     ;
    fire_MSD_A
            movf    D1,W            ; digit 1, 0..9                   |b0
            bz      display_end     ; suppress a leading zero         |b0 <-- insert
            call    LEDTABLE_A      ; get segments G/C/B/A            |b0
            xorwf   PORTA,F         ; clr active lo G/C/B/A segments  |b0

    display_end
            incf    INDEX,F         ; bump index 0..5 -> 1..6
            retlw   0               ;
     
    Last edited: May 21, 2017
    • Like Like x 1
  17. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    OHHHHHHHHHHHHH...wawwwwwwwww

    Thanks Mike to fulfill my Dream Comes TRUE.........


    Great Effort.... Thank you so much Mike.....

    See you latter.... working 100% what I really Want...

    Thank you so much, God bless you Mike..

    This code will be more useful for my future use ans study.. I need learn some coding.... You are amazing Mike....
     
  18. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    Hello Mike...

    This is you need the file which you give the link for download.... Its my pleasure to help you.. and thank you for asking a help..
    God bless you Mike..
     

    Attached Files:

  19. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    and this is another version (proteus simulation include : proteus 7) and another designe of the another author... I download from various site... I think it will help you more.... waiting your replay mike.
     

    Attached Files:

    Last edited: May 26, 2017
  20. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Hi Manoj:

    None of the archives I've found contain the source file for the project I asked you about. Here's the schematic;

    [​IMG]
    The author says the software will auto detect display type (common cathode or common anode) and I was wondering how he did that. I suspect it has something to do with that 1-MOhm resistor connected between segment 'b' and ground.

    Several years ago I experimented with using an LED as a kind of photoresistor. IIRC, you reverse bias the LED to charge it up like a capacitor, then you change the output pin to an input (or something like that) and measure the time it takes to discharge. The discharge time was affected by the amount of light shining on the LED. Anyway, I wonder if the author is simply testing to see which polarity would charge the LED 'b' segment? If so, that's kind of clever... Gosh, I wonder if you could use something like this during a short display blanking interval to determine the amount of ambient light in order to dim the display in a dark room at night?

    Cheerful regards, Mike
     
    Last edited: May 26, 2017
  21. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    Ohh.... I never use. ok Mike, I will try to get the circuit you want. ( source code for auto detect CA or CC project with all relevent files).

    And Mike, Could you help me to suppress the zero from 01.2 to 9.99 volt. This asm file already include in the first session in this thread. This is the source for common cathod display. You already give the common anode display ASM file and its working great....


    I try much time but not sucess with the help of the file you already give (CA).


    Regards.....
     

    Attached Files:

Share This Page