PIC 16f628a 7 seg. multiplexing

Discussion in 'Embedded Systems and Microcontrollers' started by abdelmoneam, Apr 10, 2015.

  1. abdelmoneam

    Thread Starter New Member

    Apr 23, 2013
    1
    0
    how to multiplex 4 digit 7 segment on portb, knowing that one of the pins is used for ccp module as input, so whatever routine I use to write on portb this specific pin should not be altered, because changing the state of that bit in software will raise its interrupt flag.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    You make a table of PORTB outputs with ten entries that specify the output for each digit. Obviously the one bit must remain unchanged. Using another port you select which digit you want to light up and hold the PORTB lines in that condition for some period of time. It must be fast enough so you can't see the digits flicker.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    When you write to the register that controls a pin, be it the PORT or the LATCH register, if the pin is an input then your write has no effect on the pin's value.

    Just leave the TRIS register alone.
     
  4. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    Hello,
    for multiplexing you have to connect all segment of display together and the driving may be common cathode or anode with a bjt like
    PORTD1=1;
    PORTD2=0;
    PORTD3=0;
    PORTD4=0;
     
Loading...