PIC 16f628a 7 seg. multiplexing

Thread Starter

abdelmoneam

Joined Apr 23, 2013
1
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.
 

Papabravo

Joined Feb 24, 2006
16,519
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.
 

ErnieM

Joined Apr 24, 2011
8,171
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.
 

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
how to multiplex 4 digit 7 segment on portb,
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;
 
Top