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

Incorrect digit display in 7-segments by using PIC

Discussion in 'Microcontrollers' started by cxiong, Apr 14, 2003.

  1. cxiong

    cxiong New Member

    Joined:
    Apr 14, 2003
    Messages:
    1
    Likes:
    0
    Location:
    Georgia
    I have tried to use the PIC16F877 to work as a temperature display
    device.

    I used a thermo sensor from radioshack. I used PORTA RA0/AN0 to do
    the ADC and used PORTD as output and connected it to all segments abcdefg (3 modules), and used
    PORTE as output - RE0 - RE2 as control signals to 3 modules (common cathode)
    through 3 transistors.

    The problem I have is that I can not display all 3 display at
    the same time. Because when all 3 display are used, I have to set
    PORTE,0,1,2 to a high state. Example, I want to display 100, (module2=1 , module1=0, &
    module0=0). What I get are all 3 modules display
    000 because all the data abcdefg of all segments connected together.

    What should I do to display the right number in each individual
    segment?

    Please help.

    Thanks...
     
  2. Chippie

    Chippie New Member

    Joined:
    Mar 8, 2003
    Messages:
    991
    Likes:
    9
    Location:
    Good 'ole England
    Can you post up the asm listing ?
     
  3. Pilot

    Pilot New Member

    Joined:
    Jan 5, 2003
    Messages:
    191
    Likes:
    0
    Location:
    England
    Not being into pic programming - yet - the only way I see the problem is...

    PORTE, RE0 - RE2, need to be high so the segments light. I would forget this idea and just wire the led's as normal.

    As the 3 led's are connected in parallel whatever you write to one will display on ALL - as long as PORTE is high so...

    Use a latching circuit on each led and use PORTE to control the latch.

    This allows you to parallel the lines from pic to latch but beyond this they must be seperate.

    Write to PORTD, set RE2 high, write to PORTD, set RE1 high, write to PORTD, set RE0 high.

    Result, if I've not drunk too much, is that each led will display what you want.

    There may be a better solution but it's too late at night & I don't program pics.

    Must go, more beer has arrived.

    :lol: :lol:
     
  4. dave

    Dave New Member

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


     
  5. KDog

    KDog New Member

    Joined:
    May 7, 2003
    Messages:
    1
    Likes:
    0
    Location:
    ACT

    Yeah that's what you need to do.

    Basically you just turn on each display for one third of the time. When that display is on it displays its data. so for 100 you might have.
    E0=high (to turn on this segment display)
    PortD=data to display 1
    E0=low (to turn off display segment)
    E1=high
    PortD=data to display a 0
    E1=low
    E2=high
    PortD=data to display a 0
    E2=low.

    It will cycle through so quickly it will appear as though the displays are on all the time. The only downside is that you loose a bit of brightness because the displays aren't actually on all the time.
     
  6. kinjalgp

    kinjalgp Active Member

    Joined:
    Oct 28, 2002
    Messages:
    1,851
    Likes:
    3
    Location:
    INDIA/USA
    Have you connected transistor at the outout of port E or you have directly connected it to supply pin of display?
    If you haven't used the transistor, then it will create a problem since port pin cannot supply current to lit 7 LEDs.
    And one more thing, in multiplexed displays LEDs are drvien at a current highr than the rated to make display brightnees comparable to non-multiplexed displays. So you need much higher current from port to drive it which can be only taken from Vcc line using a transistor.
     
  7. Stardus

    Stardus New Member

    Joined:
    May 20, 2003
    Messages:
    5
    Likes:
    0
    Location:
    Belgium

Share This Page