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
    To suppress the leading zero for 01.2 to 09.9 volts, I think you would just need to insert a couple lines. Can you try this?
    Code (text):

    fire_MSD
        btfss    INDEX,0    ;âûáîð ÷åòâåðêè ñåãìåíòîâ äëÿ îòîáðàæåíèÿ
        goto    fire_MSD_A
    fire_MSD_C
        movf    D1,w
        bz      display_end        ; <------------------------
        call    LEDTABLE_C
        iorwf    PORTC,f
        btfsc    mode    ;ðåæèì èçìåðåíèÿ íàïðÿæåíèÿ?
        goto    display_end    ;íåò, èçìåðåíèå òîêà
        Bank1    ;äà, çàñâå÷èâàåì òî÷êó âî 2-ì ðàçðÿäå
        movlw    TRIS_C_dot_ON
        movwf    TRISC
        Bank0
        bsf    coma
        goto    display_end
    fire_MSD_A
        movf    D1,w
        bz      display_end        ; <------------------------
        call    LEDTABLE_A
        movwf    PORTA  
        goto    display_end
     
     
    • Like Like x 1
  2. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    waw..... Its working good... Thanks Boss

    I am trying to contact to EDDY71 for autodetecting display type. Inform you later. thank you Mike.

    Regards Manoj
     
  3. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    238
    Likes:
    4
    Location:
    India
    Can it use to measure 100 V dc Mike...?
     
  4. dave

    Dave New Member

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


     
  5. Mike - K8LH

    Mike - K8LH Well-Known Member

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

    I think so. I believe you would replace the 150K resistor with 310K of resistance. You'd also need to change the voltage calculation code. Instead of dividing the ADC result (0..1023) by two and testing for an upper limit of 500 for a display of up to 50.0 volts, you'd leave the ADC result alone and test for an upper limit of 999 to display up to 99.9 volts.

    I can try those software changes later today, if you'd like.

    Cheerful regards, Mike
     
  6. Mike - K8LH

    Mike - K8LH Well-Known Member

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

    If you want to test the 99.9 volt modification, try replacing the VOLTAGE code section in your source file with the section of code shown below. Note that this code works for the original 49.9v AVMeter (R2 = 150K) or 99.9v (R2 = 310K) by setting the 'limit' constant to either 500 or 1000 before assembling the code.

    Cheerful regards, Mike

    Code (text):

    VOLTAGE
            bsf     mode            ; voltage mode (1 decimal place)  |00
    ;
    ;  test for voltage based on the 'limit' constant
    ;
    ;  use 'limit'  500 for 49.9v upper limit (R2 = 150K)
    ;  use 'limit' 1000 for 99.9v upper limit (R2 = 310K)
    ;
            radix   dec
    #define limit   1000            ; 500 (49.9v) or 1000 (99.9v)

        if limit == 500             ; if 49.9v range (R2 = 150K)
            clrc                    ; divide ADC result by two        |00
            rrf     DH,F            ;  "                              |00
            rrf     DL,F            ;  "                              |00
        endif
    ;
    ;  test for voltage value limit (500 or 1000)
    ;
    calc_voltage
            movlw   high(limit)     ;                                 |00
            subwf   DH,W            ;                                 |00
            movlw   low(limit)      ;                                 |00
            skpnc                   ;                                 |00
            subwf   DL,W            ; DH:DL < limit?                  |00
            skpc                    ; no, skip, else                  |00
            goto    do_BCD          ; convert value to Decimal        |00
            movlw   10              ; display "---" (range error)     |00
            movwf   D1              ; '-'                             |00
            movwf   D2              ; '-'                             |00
            movwf   D3              ; '-'                             |00
            goto    MAIN            ; loop                            |00
    ;  
    Please disregard the above code. The only change that had to be made to the code for 100v operation was to add a single line to the source file;
    Code (text):

    VOLTAGE
            bsf     mode            ; voltage mode (1 decimal place)  |00
            goto    calc_current    ; 99.9v mod (R2 = 310K)           |00 <-- add
     
     
    Last edited: May 28, 2017
    • Like Like x 1
  7. manoj soorya

    manoj soorya Member

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

    Will try with your codes...

    Regards Manoj
     
  8. manoj soorya

    manoj soorya Member

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

    There is something unusual. Its showing some kind of error.

    Can you give me the complete code or 99.9 V CA and CC with zero suppres hex file only?

    " 99.9 V CA and CC with zero suppres hex file only?"

    Regards Manoj
     
    Last edited: May 27, 2017
  9. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    This is the only complete file I have...
     

    Attached Files:

    • Like Like x 1
  10. manoj soorya

    manoj soorya Member

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

    I tested your code AVMeter_CA_LZ_99V.asm and its working Great.

    So I have

    1. 50 Volt Common Anode DC Volt Meter
    2. 50 Volt Common Cathod DC Volt Meter
    3. 50 Volt Common Anode DC Volt Meter ( Suppresing Zero MSD. like 01.2 to 1.2V)
    4. 50 Volt Common Cathod DC Volt Meter ( Suppresing Zero MSD. like 01.2 to 1.2V)
    5. 100 Volt Common Anode DC Volt Meter ( Suppresing Zero MSD. like 01.2 to 1.2V) many thanks for your attension in this post and valuable help.

    One more request Mike, I like to make this one too, I hope your help.

    6. 100 Volt Common Cathod DC Volt Meter ( Suppresing Zero MSD. like 01.2 to 1.2V)

    Thanks again for your Valuable Help..
     
  11. manoj soorya

    manoj soorya Member

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

    You can use this PCB for the above Meter. Its display only the voltage.

    Thanks Mike - K8LH for his valuable help.

    I share this PCB for who want to make this voltmeter. More details will get on this thread. Thank you



    [​IMG] https://postimg.org/image/6tm6hdth7/




    [​IMG]
     

    Attached Files:

    Last edited: Jun 9, 2017

Share This Page