Electronics > Microcontrollers

Multiplexing problem - White LED ghosting

(1/4) > >>

hun_yeti:
Hello.

I'm working on a little MCU controlled LED flashlight.
I have a great problem with it: LED ghosting.

It is starting to appear when the switching frequency goes above only a 100hz

I have search Google in this topic, and I have found information that it is maybe because of the stray capacitance of the common anode line, and resistors from the collector  of the transistor  to ground can help with this.

I tried it, even very low value resistors didn't make any difference and I don't have and oscilloscope to check out what is going on exactly.

I even tried to insert a blank frame between each multiplexing but it didn't reduce ghosting, just the overall brightness (as expected).

Maybe the problem is with the code, but i can't find out what it is...
I'm using a TI MSP430g2252 20pin dip.
Here is the code:


--- Code: ---pic1=0x55;
pic2=0xaa;


if (mpx==10){ //check flag for interrupt (2khz)
mpx=0; //clear flag
if (mpxs==1){ //multiplex segment
P2OUT=BIT0+BIT1;//turn off both segments (pnp bc327)
P1OUT=pic1; //Push character to segment (npn bc337)
P2OUT = BIT1; //Turn on Active segment
mpxs=0;} //Next time start with


else if(!mpxs){ //the other segment
P2OUT=BIT0+BIT1;
P1OUT=pic2;
P2OUT = BIT0;
mpxs=1;}
--- End code ---
On this picture the multiplexing is running at 1Khz(visible ghosting)


 on this picture it is multiplexing at a 100Hz ( no visible ghosting , but flickering to human eye)


Thanks for the help in advance!

shebu18:
A clip would be better then pics.

hun_yeti:
You are right!
here is a little clip:

ColinB:
Can you post a schematic please?

Am I correct in observing that the LED in the row above (and below?) the illuminated LED is ghosting, but not the ones in the adjacent columns (left/right)?  Based on your orientation in the video, where the transistors are below the LED matrix.

ColinB:
You might be able to tell something by doing a test where you switch only the 2 "commons" and another test where you switch only the 8 "segments" to see if the ghosting is related to only one of these.

Something like the following (two separate test code snippets):

--- Code: ---pic1=0x55;
pic2=0xaa;

// Test 1:
// Test switching "commons" only - same data
// driven to segments for each case.

if (mpx==10)            //check flag for interrupt (2khz)
{
    mpx=0;              //clear flag
    if (mpxs==1)        //multiplex segment
    {
        P2OUT=BIT0+BIT1;//turn off both segments (pnp bc327)
        P1OUT=pic1;     //Push character to segment (npn bc337)
        P2OUT = BIT1;   //Turn on Active segment
        mpxs=0;
    }                   //Next time start with
    else if(!mpxs)      //the other segment
    {
        P2OUT=BIT0+BIT1;
        P1OUT=pic1;     // Note USING pic1 ON BOTH COMMONS
        P2OUT = BIT0;
        mpxs=1;
    }
}

// Test 2:
// Test switching "segments" only - same data
// driven to commons for each case.

if (mpx==10)            //check flag for interrupt (2khz)
{
    mpx=0;              //clear flag
    if (mpxs==1)        //multiplex segment
    {
        P1OUT=pic1;     //Push character to segment (npn bc337)
        P2OUT = 0;      //Turn on both commons (BIT1 and BIT0)
        mpxs=0;
    }        //Next time start with


    else if(!mpxs)      //the other segment
    {
        P1OUT=pic2;     //Drive the alternate pattern to segments
        P2OUT = 0;      //Turn on both commons (BIT1 and BIT0)
        mpxs=1;
    }
}

--- End code ---

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod