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.

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

Status
Not open for further replies.
Mike One problem, I detect..

In your programme, Last Digit, segment 'd' and 'f' have some error.. But Proteus simulation is 100% OK....

Please check your code again...

Thanks you..
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:
If the last digit is the single digit used to display "A" or "V",

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:
i can do a check on the timings.

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....
 

Attachments

  • AV Meter CA.rar
    120.7 KB · Views: 196
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?
 
220ohm to 330 ohm dropping resistr?

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
 
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:
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:
Hi Manoj:

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

Thank you. Cheerful regards, Mike
 
May I ask if you know how you hook up that circuit for current measurement, please?


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...

https://cxema.my1.ru/publ/instrumen...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
 
Thank you for the link, Manoj.

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

Code:
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:
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....
 
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..
 

Attachments

  • 2816_85_Voltmetr676d.zip
    61.9 KB · Views: 160
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.
 

Attachments

  • PIC 16F676 99 Volt DC Meter.rar
    275.6 KB · Views: 175
Last edited:
Hi Manoj:

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

**broken link removed**
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:
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.....
 

Attachments

  • avmeter CC.asm
    10.4 KB · Views: 160
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top