This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiplexed 7 segment display scanning

I am using 6 7-segment displays which are multiplexed using a 3:8 multiplexer. I am displaying ADC readings on the display. I am unable to find a point wherein the display would not flicker but show continuous reading (ADC: ADS1230, uC: 89V51RD2, Communication via SPI)
Here's my current code for displaying results.

code const unsigned char ActualDigit[10] = {
    0xC0, 0xF9, 0xA4,
    0xB0, 0x99, 0x92,
    0x82, 0xF8, 0x80,
    0x98
};

code const unsigned char DigitSelect[6] = {
    0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0
};

void segdelay()
{
    int i;
    for(i=0; i<=200; i++);
}


void turnOffAll()
{
        char i;
        for(i=0;i<6;i++)
        {
                P2 &= ~((1<<5) | (1<<6) | (1<<7));
                P2 |= DigitSelect[i];
                P0 = 0xFF;
        }
}

void showData(int adcresult)
{
        int digits[6];
        char count = 0,i;
        while(adcresult)
        {
                digits[count++] = adcresult % 10;
                adcresult/=10;
        }
        for(i=0;i<count;i++)
        {
                P2 &= ~((1<<5) | (1<<6) | (1<<7));
                P2 |= DigitSelect[i];
                P0 = ActualDigit[digits[i]];
                segdelay();
                turnOffAll();
        }
}

0