Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
What's the best way to control these? Obviously I don't want to devote so many I/O ports to them,
But, if I'd do this it'd be dumb to use a reprogrammable chip to do it, since one time programmable chips are cheaper, and a reprogrammable chip would be overkill.
If I did it this way, would I be able to communicate to other things too? Could I simply use transistors to communicate to different things?
Would it be possible to do it in other ways?
A crazy idea that just popped into my head was using some sort of PWM then (somehow) use another chip to analyze the PWM signal then make decisions based on that. Of course, that'd be if you didn't need the PWM ports (which are much less plentiful than the general I/O ports). I wonder what would happen if you ran PWM into an ADC port of another MCU... I mean sure if you look at the voltage it'll average out to something, but the MCU is much quicker than you, so would it just see the 5V on or 5V off? I know, I'm crazy and it'd probably never work.
That depends...What is "many"?
If you produce hundreds of thousands, the difference will be worth it, but in your case...Are you sure you get it right in the first go?How many cents can you save?What if you later wanna change the functionality even the slightest?
Not quite sure what you mean here?
Depending on how many lines you wanna dedicate to the task...A display driver IC like one of those from the CMOS 4k series is cheap. It will drive the segments from 4 lines of I/O. Then you need to mux the displays. For a 4 digit display, you can either use 4 lines, or 2 lines with a 3-8 line chip - and for each digit you need a transistor.
Personally, I like the idea of a dedicated chip much better and then you can make it with SPI, IIC or whatever you like (or even a selection to choose from).
Using one I/O line per segment (including a decimal point) and one per digit means 12 lines for a 4 digit display. 1..2 lines is needed for the input and perhaps a couple of I/O more if you want to be able to set it up for different protocols - lets say 16 pins for 4 digits (18 pins for 6 digits) and finally, 2 pins for power - using a chip with internal RC oscillator (nothing time critical here) means that it could be made in a 18..20 pin chip.
QuoteUsing one I/O line per segment (including a decimal point) and one per digit means 12 lines for a 4 digit display. 1..2 lines is needed for the input and perhaps a couple of I/O more if you want to be able to set it up for different protocols - lets say 16 pins for 4 digits (18 pins for 6 digits) and finally, 2 pins for power - using a chip with internal RC oscillator (nothing time critical here) means that it could be made in a 18..20 pin chip. You lost me here. How can I use one I/O line per segment. And how does that add up to 12 lines for a 4 digit display? If you're talking about using a MCU for the "display driver", why can't I just hook each segment up to an I/O port (through a resistor and maybe a transistor)? Therefore for a single digit display, I'd need a MCU with 8 I/O pins, and for a 2 digit display I'd need one with 16 I/O pins etc?
Using one I/O line per segment (including a decimal point) and one per digit means 12 lines for a 4 digit display. 1..2 lines is needed for the input and perhaps a couple of I/O more if you want to be able to set it up for different protocols - lets say 16 pins for 4 digits (18 pins for 6 digits) and finally, 2 pins for power - using a chip with internal RC oscillator (nothing time critical here) means that it could be made in a 18..20 pin chip. As you probably will want to use Atmel chips, I cannot tell you which is best suited for the task in relation to the price, but I'm sure Atmel has a selection tool somewhere on their site.
and hammer the segments with the max. current the controllers port can handle (not 8 times what a single I/O can handle - see datasheet), as the average current will be low due to the mux'ing.
DC Current per I/O Pin ............................................... 40.0 mA
So in this case the "controller" is the AtMega8 (or whatever chip I'd use). And on the datasheet for the atmega8 it says, MAX specifications..QuoteDC Current per I/O Pin ............................................... 40.0 mA.
So I should calculate my resistor to provide 40mA to the LED? (Well, actually the AtMega is sinking, not driving... is that the right wording?)The datasheet for the display says typical ratings are 20mA at 2V, but I want 40mA so...R=(Vs-Vl)/I......... = (5-2)/.040 = 75 Ohms. So the next resistor up from 75 ohms will be good... right?
EDIT: Man I'm glad I didn't have a blue or white display... I guess I could always just put transistors on them too. I'd need to use NPN transistors, right?