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 common cathod to common anode seven segment display...

Discussion in 'Oshonsoft' started by manoj soorya, Sep 5, 2016.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,588
    Likes:
    821
    Location:
    Rochdale UK
    Okay.... If you have wired it the same you will also need to flip port C... But you nee to take care of the two LED's on RC6,7
     
    • Like Like x 1
  2. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    Need to convert Port C also? Not Port B? I can neglect RC6 and RC7.. Its for memory

    So, How is possible to change the code?

    Can you do it for me?

    Thank you
     
  3. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,533
    Likes:
    116
    Location:
    morristown,tn
    Without the schematic it's a shot in the dark. What Ian said should work it's the easy way to do what I was saying but the hardware needs changes to I said that too.
     
  4. dave

    Dave New Member

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


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,588
    Likes:
    821
    Location:
    Rochdale UK

    Code (asm):

    VIBR_RAZRAD
      BSF  PORTA,5
      BSF  PORTA,4
      MOVF  INDEX,W
      ADDWF  PCL,F
      RETLW  B'01111111'
      RETLW  B'10111111'
      RETLW  B'11011111'
      RETLW  B'11101111'
      RETLW  B'11110111'
      RETLW  B'11111011'
      RETLW  B'11111101'
      RETLW  B'11111110'
      MOVLW  B'11111111'
      BCF  PORTA,4

      RETURN
     
    This is the portion that drives port C... You need to flip the bits..
     
    • Like Like x 1
  6. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    I just flip the code just like this.. Is this Okey?

    code (asm):

    VIBR_RAZRAD BSF PORTA,5

    BSF PORTA,4

    MOVF INDEX,W

    ADDWF PCL,F

    RETLW B'10000000' ;'01111111'

    RETLW B'01000000' ;'10111111'

    RETLW B'00100000' ;'11011111'

    RETLW B'00010000' ;'11101111'

    RETLW B'00001000' ;'11110111'

    RETLW B'00000100' ;'11111011'

    RETLW B'00000010' ;'11111101'

    RETLW B'00000001' ;'11111110'

    MOVLW B'00000000' ;'11111111'

    BCF PORTA,4

    RETURN



    ]

    But is not working too... Any other setting need?
     
  7. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    Only need to flip these bit only? any other changes need? Any hardware change need?
     
    Last edited: Sep 7, 2016
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,588
    Likes:
    821
    Location:
    Rochdale UK
    If I get chance tonight, I'll make it work!!
     
    • Like Like x 1
  9. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,075
    Likes:
    257
    Location:
    Richmond Hill , ON Canada near Toronto
    schematic details are missing in the high current digit drivers.

    This change from NPN for CC digit to PNP for CA digit must be able to drive the same current as before with same Vce(sat).

    Both software and hardware driver logic must be inverted.
     
  10. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    Thank you very Much for your kind... Thank you.

    I am waiting for your kind..
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,588
    Likes:
    821
    Location:
    Rochdale UK
    Whooh!! Its hard coded... The code blanks the display every change od digit so 888888 seems to dominate... I'll see if I can sort it!
     
  12. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,075
    Likes:
    257
    Location:
    Richmond Hill , ON Canada near Toronto
    so the blank (1) has to be inverted too
     
  13. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1

    My hardware is ready to test your code..... :)
     
  14. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,588
    Likes:
    821
    Location:
    Rochdale UK
    Nearly there... The blanking is fixed to clrf PORTB I have to change it to movlw 255 and movwf PORTB on each digit!
     
  15. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    Great Job Master
     
  16. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    Is the coding is complex, Master?
     
  17. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,588
    Likes:
    821
    Location:
    Rochdale UK
    Try this...
     

    Attached Files:

    • vt2.asm
      File size:
      198.2 KB
      Views:
      36
    • Like Like x 1
  18. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    :woot:


    Waw....... Its working now... Great. But I need to some more bright in the display is good...

    Only for hardware change need? Not done in source?
     
  19. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    I appriciated your hardwork.....Great
     
  20. manoj soorya

    manoj soorya Member

    Joined:
    Aug 23, 2014
    Messages:
    136
    Likes:
    1
    I just use PNP transistor in the Common Anode pin in the seven segment display.. Now its Okey. But how can I ignore these transistors for reduce the total cost?

    It can be controlled through the source code to change the duty cycle of the micro controller?
     

Share This Page