I setup my microcontroller to illuminate a 3-digit 7-segment display (CA) as well as a 4-digit 7-segment display (CA). The micro outputs using shiftOut to one latch (which connects to the 8 Cathode pins of both 7-segment displays) and also outputs to another latch (connected to the CA pins of both 7-segments) using shiftOut.
Each individual 7-segment (7-digits total) are illuminated one by one. All 7 digits are illuminated without any flickering; however, if I want to add more to my program (ex. poll an RF wireless module for incoming data) the LEDs flicker.
Is there a way I can run both procedures (polling wireless data & outputting to 7 7-segment LEDs) without any flickering from the LEDs?
The only thing I can think of is latching each 7-segment display, but 7 latches seem like overkill. Is there another way I can do this? Have a smaller microcontroller drive the LEDs?
I'm outputting to two latches (one to the 8-bit cathodes and the other to
however, if I want to add more to my program (ex. poll an RF wireless module for incoming data) the LEDs flicker.
It depends on how you are driving the multiplexing. Avoid using the delay() function in that way you can use this time to pole. Look at the "blink without delay" tutorial.
I'm using one of the analog pins as input from a RF wireless module. This signal continuously toggles high and low even when I'm not sending data. I don't think adding an interrupt would work unless I can differentiate random noise signals from the signal I'm looking for before the signal reaches the micro. This way the analog input pin only goes high when I have the signal I'm looking for.
I'm driving the 7 7-segment LEDs by using two 74HCT595N, Serial in Parallel Out Shift Registers. The 7-segment LEDs are Common Anode (CA). The first shift register connects to the 7 anode pins. The second shift register connects to the cathodes. Each 7-segment LED is illuminated one at a time. Without any delay() statements in my program there is no flickering from any of the LEDs.
The problem is that it takes about 1 second to read the wireless signal, assuming the transmitter is continuously sending data. This would mean that the LEDs would flicker at 1 second intervals. I can't send/read any faster than I already am.
Without any delay() statements in my program there is no flickering from any of the LEDs.
Yes but is that just going as fast as it can or is that only refreshing it at a set interval? In other words using a delay but without calling the delay function.
If the refresh can't be done on a timed interrupt and you can't interrupt the reading of your signal the only thing you can do is to move the multiplex function into some hardware chip like a MAX6954.
It's going as fast as it can. I'm programming the micro to function as a local temperature sensor, clock, and wireless temperature sensor.
I had flickering problems before adding the wireless module as well, but this was because I was using division and the pow() function. I eventually got rid of those and fixed the problem.
I don't know too much about the MAX6954, but it looks like the multiplexing setup I have is very similar to it. Can I send the values I want for each digit to the MAX6954 chip once and it will latch those inputs on its own? That way the micro just needs to update the clock every minute and would have time to listen for a wireless signal.
So that is your problem, you need to schedule the refreshing so that it only happens at the fixed rate you need, not as fast as it will go. This is because any time taken off this refresh rate will show up as a brightness variation.
Look how I did it in the link I posted earlier. The multiplexed display is only moved on to the next row after a time has elapsed.
Can I send the values I want for each digit to the MAX6954 chip once and it will latch those inputs on its own?
Yes you only have to load the chip when you want to change it, it will do all the multiplexing by itself.
I've sampled the MAX6954 and it seems I can only get it to work using individual 7-segment LEDs. I won't be able to implement Charlieplexing with my 4-digit 7-segment LEDs.
Another thing is that the MAX6954 chip is about $6-$8 per chip. It might be best if I used two microcontrollers for this project. (Maybe 2 ATTINY84-20PU, $2.90 each from digi-key)
I'm just wondering if this is the best way to design this project. Using two micros vs 1 micro + MAX6954 vs fpga...etc.
(FWIW, I've never quite understood the popularity of the Maxim LED-driver chips. While somewhat convenient (perhaps), they also seem to be ridiculously expensive. Even adding another Arduino chip is significantly cheaper. (ATmega8 being less than $3...))