Jump to content
43oh

Four digit seven segment blinking problem


Recommended Posts

Hi, I'm writing display functions that will display an unsigned integer or a float on a four digit seven segment display with the MSP430 launchpad and I'm running into a problem. 

 

In the infinite 'for' loop, displaying a number works fine if it's only display one number:

int counter = 100;
for(; {
    displayUint(counter); //a function in the code
}

However, if counter is to increased, the first digit of the 4 digit remains brightly lit while other digits blinks very quickly.

int counter = 100;
for(; {
    displayUint(counter++);
    delay(1000); //delay 1 second
}

Schematic of circuit: http://i40.tinypic.com/2cqcim0.jpg

Code: http://pastebin.com/LCrHeDur

 

In this case, I didn't use transistors. I don't get the point of using them and using resistors are simple enough. As for display functions, I'm sure there are more efficient ways of getting individual digits but I haven't found much. If you do know a way, please tell me. Other than that, I'm stuck with the blinking problem and I can't work out why it's not working.

Link to post
Share on other sites

There must be some delay between the displaySingle() calls. Best way to do that is to use an interrupt just fast enough to prevent flicker. 

 

Don't do blocking! try something like this

set timer interval to 1 second
for(;{
  display(counter);
}

void timer_isr(){
  counter += 1;
}

 

Thanks for the interrupt. That fixes the flickering problem. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...