Searching \ for '[PIC] IC-selection / design-question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'IC-selection / design-question'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] IC-selection / design-question'
2007\02\19@165354 by Rikard Bosnjakovic

picon face
I'm still waiting for my PIC-programmer to arrive, but I cannot sit
idle so I borrowed a couple of books at the library and started to
read about PIC-assembler, PIC-layouts etc.

There is one thing that struck me. For my project, I'm going to have 5
mechanical switches (or around there) and 3 dual 7-LED segments. Now,
how do you professionals "think" in a scenario like this, where the
microcontroller is supposed to control all switches and LEDs?

What I mean is, the big PIC I saw had 4 tristate A-ports (A0-A3 IIRC)
and 8 B-ports (B0-B7). Given the fact that each LED-segment requires 7
outputs, how would you design the circuit? Multiplexers between the
PIC and the segments?  I'm still unskilled - practically - with
mux'es, but there's never too late to learn.

--
- Rikard.

2007\02\19@172944 by peter green

flavicon
face
>There is one thing that struck me. For my project, I'm going to have 5
>mechanical switches (or around there) and 3 dual 7-LED segments. Now,
>how do you professionals "think" in a scenario like this, where the
>microcontroller is supposed to control all switches and LEDs?
>
> What I mean is, the big PIC I saw had 4 tristate A-ports (A0-A3 IIRC)
> and 8 B-ports (B0-B7).
thats not a particularlly big pic (i'm guessing its something like a 18 or 20 pin at that IO count), 28 and 40 pin units are easilly accessible to the hobbyist and even higher pin count pics exist if you are happy with fine pitch surface mount.

in your case you probablly want 5+3+7=15 IO lines so a 28 pin pic from your preffered series (i suggest the 18F2620) should do nicely, some 20 pin ones could probablly do it but you'd be getting very short on IO and thats not a good situation to be in for a begginner. In particular disabling MCLR while using internal oscilator is a very bad idea unless you are absoloutely sure you have a programmer capable of getting a PIC in that state into program mode reliablly. It also makes in cuircuit programming much easier (and is essential for using the ICD2 to debug) if you can keep the lines used for programming free of other uses.

> Given the fact that each LED-segment requires 7
> outputs, how would you design the circuit?
the normal way to handle 7 segment displays is to rely on the human eyes persistance of vision, as long as you cycle through the displays fast enough you only need to have one display on at a time.

the normal way to achive this is to use a transistor (something like the good old 2n3904 or 2n3906 depending on if you want a NPN or PNP) to switch the common line of each display (since the common line will sometimes be carrying power for 7 segements at once its a bit much for a PIC IO line to drive directly) and then connecting the corresponding segements from each display together to PIC IO lines.



2007\02\19@173445 by Bob Axtell

face picon face
Rikard Bosnjakovic wrote:
> I'm still waiting for my PIC-programmer to arrive, but I cannot sit
> idle so I borrowed a couple of books at the library and started to
> read about PIC-assembler, PIC-layouts etc.
>
> There is one thing that struck me. For my project, I'm going to have 5
> mechanical switches (or around there) and 3 dual 7-LED segments. Now,
> how do you professionals "think" in a scenario like this, where the
> microcontroller is supposed to control all switches and LEDs?
>
> What I mean is, the big PIC I saw had 4 tristate A-ports (A0-A3 IIRC)
> and 8 B-ports (B0-B7). Given the fact that each LED-segment requires 7
> outputs, how would you design the circuit? Multiplexers between the
> PIC and the segments?  I'm still unskilled - practically - with
> mux'es, but there's never too late to learn.
>
>  
My guess is that the LED-segment devices are designed to be
multiplexed.  But since the PIC
can't directly drive LEDs with sufficient current, you will need to
design SINK and SOURCE
drivers. There is about 100,000 different ways to do it.

My favorite way to handle 5 to 7 switches is to arrange them so that
when one is pressed, it applies a unique voltage level to the AN0 input
when pressed. In that
way, only ONE pin on the PIC is used for all 5 to 7 switches. Since you
will need
pullup resistors anyway, you need one resistor for each switch, but it
is wired in series, not
like a pullup.

--Bob

2007\02\19@175541 by William Chops Westfield

face picon face

On Feb 19, 2007, at 1:53 PM, Rikard Bosnjakovic wrote:

> the big PIC I saw had 4 tristate A-ports (A0-A3 IIRC) and
> 8 B-ports (B0-B7). Given the fact that each LED-segment
> requires 7 outputs, how would you design the circuit?
> Multiplexers between the PIC and the segments?

I'd demux the digit select lines (3-8line mux) and drive the
segments directly.  With a bit of luck, you can find a demux
that will sink/source enough current that you won't need the
traditional transistor on each digit.

You can use the same ports that drive the LEDs to scan for
inputs; it's not complicated once you think about it...

BillW

2007\02\19@181729 by peter green

flavicon
face

> My guess is that the LED-segment devices are designed to be
> multiplexed.  But since the PIC
> can't directly drive LEDs with sufficient current, you will need to
> design SINK and SOURCE
> drivers. There is about 100,000 different ways to do it.
you will need drivers for the common lines but i don't see why you would need them for the segement lines unless you are doing a very large multiplexed bank (and so need very high currents).

>
> My favorite way to handle 5 to 7 switches is to arrange them so that
> when one is pressed, it applies a unique voltage level to the AN0 input
> when pressed. In that
> way, only ONE pin on the PIC is used for all 5 to 7 switches. Since you
> will need
> pullup resistors anyway, you need one resistor for each switch, but it
> is wired in series, not
> like a pullup.
thats certainly a possibility but i tend to find the ADC slow and irritating to work with.





2007\02\19@185616 by Jinx

face picon face
> Given the fact that each LED-segment requires 7 outputs, how
> would you design the circuit? Multiplexers between the PIC
> and the segments?

Correct

http://home.clear.net.nz/pages/joecolquitt/2wireled.gif

http://home.clear.net.nz/pages/joecolquitt/2wireled.jpg

http://home.clear.net.nz/pages/joecolquitt/2wireled.zip

and

http://home.clear.net.nz/pages/joecolquitt/counter.gif

and

http://home.clear.net.nz/pages/joecolquitt/message.html

As Peter said, persistence of vision

For keypads/switches/buttons you do the reverse. Scan inputs
rather than scan outputs

2007\02\19@194540 by peter green

flavicon
face

>
> home.clear.net.nz/pages/joecolquitt/2wireled.gif
>
> home.clear.net.nz/pages/joecolquitt/2wireled.jpg
>
> home.clear.net.nz/pages/joecolquitt/2wireled.zip
>
> and
>
> home.clear.net.nz/pages/joecolquitt/counter.gif
>
> and
>
> home.clear.net.nz/pages/joecolquitt/message.html
>
> As Peter said, persistence of vision
but i really don't see the point in using two extra chips when you can easilly get a PIC with sufficiant pins to do it without much help (still need the transistors on the common lines)

>
> For keypads/switches/buttons you do the reverse. Scan inputs
> rather than scan outputs
you can but for 5 buttons its not worth it. a 3x2 grid (the minimum that would cover it) would take just as many io lines as reading the buttons individually. also note if you want to correctly read multiple buttons pressed together you need diodes combined with the buttons (it would be possible to combine the switch inputs with the LED outputs but diodes would be required to make it work right).

the whole point of microcontroller based design imo is to try and keep external cuircuitry to a minimum. One of the larger PICs plus a few helper transistors for the common lines on the 7 segment displays, a few pullups for the inputs, some power supply decoupling and a crystal cuircuit is all that is needed to satisfy the original posters design requirements.

IMO using external chips to save IO is something you should only do if simply moving to a bigger microcontroller is not an option. There does of course come a point where moving to a bigger microcontroller simply isn't feasible (a hobbyist without surface mount skills can't really go beyond 40 pin devices) but in general by that point the project has got sufficiantly complex that multiple microcontrollers are probablly easier.


2007\02\19@200645 by Bob Axtell

face picon face
peter green wrote:
>> home.clear.net.nz/pages/joecolquitt/2wireled.gif
>>
>> home.clear.net.nz/pages/joecolquitt/2wireled.jpg
>>
>> home.clear.net.nz/pages/joecolquitt/2wireled.zip
>>
>> and
>>
>> home.clear.net.nz/pages/joecolquitt/counter.gif
>>
>> and
>>
>> home.clear.net.nz/pages/joecolquitt/message.html
>>
>> As Peter said, persistence of vision
>>    
> but i really don't see the point in using two extra chips when you can easilly get a PIC with sufficiant pins to do it without much help (still need the transistors on the common lines)
>  

again, in theory the PIC will provide enough current, but the result
will be dim because the PIC can only sink 25mA; in a multiplexed
arrangement the current needs to be on the order of 60-200mA
to be bright enough.

--Bob
{Quote hidden}

2007\02\19@203023 by peter green

flavicon
face

> > but i really don't see the point in using two extra chips when
> you can easilly get a PIC with sufficiant pins to do it without
> much help (still need the transistors on the common lines)
> >  
>
> again, in theory the PIC will provide enough current, but the result
> will be dim because the PIC can only sink 25mA; in a multiplexed
> arrangement the current needs to be on the order of 60-200mA
> to be bright enough.
ouch, what kind of displays are you building to need that kind of power?

for a 6 digit system with normal sized displays used under household conditions i'd think a 330ohm series resistance (~10ma drive) would be perfectly bright enough, especially if you cover the displays with a filter (filters hugely increase your contrast ratio and make the display look nicer too, highly reccomended).

one final note, don't start driving LEDs over thier rated max continuous current until you are very confident you have your software right, the last thing you want is your code hanging and frying a display.



2007\02\19@204305 by Phillip Coiner

picon face
part 1 3331 bytes content-type:text/plain; (decoded 7bit)

Hi All
This is how I did it.
The LEDS are plenty bright...it depends on how fast/duty cycle them on.
There are only two input switches but it would be easy to add more.
The RB lines are to control a digital attenuator.
The RA0 line read a voltage.
The up and down controlled a serial/digital EE pot.

I have a PIC development board that uses an 18F452 that you can have if you
pay for the postage. (It has been hacked around on a little but it could be
easily fixed.)
Now that I know enough to be dangerous I just roll my own boards so it is
just gathering dust cooties.



Phillip
Things should be as simple as possible but no simpler



Phillip Coiner
CTO, GPS Source, Inc.


Your source for quality GNSS Networking Solutions and Design Services, Now!
{Original Message removed}

2007\02\19@211629 by Bob Axtell

face picon face
peter green wrote:
>>> but i really don't see the point in using two extra chips when
>>>      
>> you can easilly get a PIC with sufficiant pins to do it without
>> much help (still need the transistors on the common lines)
>>    
>>>  
>>>      
>> again, in theory the PIC will provide enough current, but the result
>> will be dim because the PIC can only sink 25mA; in a multiplexed
>> arrangement the current needs to be on the order of 60-200mA
>> to be bright enough.
>>    
> ouch, what kind of displays are you building to need that kind of power?
>
> for a 6 digit system with normal sized displays used under household conditions i'd think a 330ohm series resistance (~10ma drive) would be perfectly bright enough, especially if you cover the displays with a filter (filters hugely increase your contrast ratio and make the display look nicer too, highly reccomended).
>
> one final note, don't start driving LEDs over thier rated max continuous current until you are very confident you have your software right, the last thing you want is your code hanging and frying a display.
>  

Hmmm. No point in arguing. Why don't you try it and see what you need?

You see, the eyes are not deceived by multiplexing. The "apparent"
brightness at 10mA will be invisible in daylight. Try it and decide for
yourself.

Maybe the filter will help.

--Bob
>
>
>  

2007\02\19@215418 by Jinx

face picon face
> but i really don't see the point in using two extra chips when you can
> easilly get a PIC with sufficiant pins to do it without much help (still
> need the transistors on the common lines)

It's true you can drive a small number of segments with a PIC
directly. However, as the number is increased, the off time starts
to get very long compared with the on time, and the inevitable
result of that is dimming. I'm sure you realise this, but for Rikard's
benefit, what the 74HC164 shift register and 4511 do together is
act as an I/O expander and driver. The 4511 lights all relevant
segments simultaneously, so it is only the whole digit that needs to
be addresses by the PIC

For the circuit using the 4543, the digit shape is actually latched
and there is no flicker. It does use more current, because of the
static nature of that, and is therefore brighter for the same value
resistors as the multiplexed display

Handy if you're making a "Hollywood" bomb and (a) need to
spell it out for the audience and (b) not strobe with the camera ;-)

If you look at a commercial moving message display, you'll find
the LEDs are driven very hard very briefly. Very briefly a PIC
can do, very hard it can't. Not into say 47 ohms at 12V. All of
the components do get pretty warm

Part of the exercise too is a design challenge. There are many
reasons why you might not want to tie up the micro with more
display refreshing than it needs to

2007\02\19@221315 by peter green

flavicon
face


> -----Original Message-----
> From: spam_OUTpiclist-bouncesTakeThisOuTspammit.edu [.....piclist-bouncesKILLspamspam@spam@mit.edu]On Behalf
> Of Jinx
> Sent: 20 February 2007 02:54
> To: Microcontroller discussion list - Public.
> Subject: Re: [PIC] IC-selection / design-question
>
>
> > but i really don't see the point in using two extra chips when you can
> > easilly get a PIC with sufficiant pins to do it without much help (still
> > need the transistors on the common lines)
>
> It's true you can drive a small number of segments with a PIC
> directly. However, as the number is increased, the off time starts
> to get very long compared with the on time, and the inevitable
> result of that is dimming. I'm sure you realise this, but for Rikard's
> benefit, what the 74HC164 shift register and 4511 do together is
> act as an I/O expander and driver. The 4511 lights all relevant
> segments simultaneously, so it is only the whole digit that needs to
> be addresses by the PIC
umm i wasn't proposing one segment at a time drive, one digit at a time drive should be fine with a decent sized pic driving the segments directly and transistors on the commons.


> For the circuit using the 4543, the digit shape is actually latched
> and there is no flicker. It does use more current, because of the
> static nature of that, and is therefore brighter for the same value
> resistors as the multiplexed display
>
> Handy if you're making a "Hollywood" bomb and (a) need to
> spell it out for the audience and (b) not strobe with the camera ;-)
Just crank up the mux frequency to a point where this is no longer a propblem.

>
> If you look at a commercial moving message display, you'll find
> the LEDs are driven very hard very briefly. Very briefly a PIC
> can do, very hard it can't. Not into say 47 ohms at 12V. All of
> the components do get pretty warm
yeah, and fry themselves if the muxing fails to work properly.

a big moving message board is a somewhat bigger deal than a few 7 segment displays though.


2007\02\20@004701 by Vasile Surducan
face picon face
On 2/19/07, Rikard Bosnjakovic <rikard.bosnjakovicspamKILLspamgmail.com> wrote:
> I'm still waiting for my PIC-programmer to arrive, but I cannot sit
> idle so I borrowed a couple of books at the library and started to
> read about PIC-assembler, PIC-layouts etc.
>
> There is one thing that struck me. For my project, I'm going to have 5
> mechanical switches (or around there) and 3 dual 7-LED segments. Now,
> how do you professionals "think" in a scenario like this, where the
> microcontroller is supposed to control all switches and LEDs?

You didn't say if the LED's may be switched or not ( a fast turned
on-off-on LED will be visible as continuous on). You need no more-no
less than 7 + 3 IO for 3x7 LED display and 5 switches and no auxiliary
hardware.

Vasile

2007\02\20@011817 by Jinx

face picon face
> umm i wasn't proposing one segment at a time drive, one digit at a
> time drive should be fine with a decent sized pic driving the segments
> directly and transistors on the commons

Of course. What you have there is an I/O expander made by
Microchip ;-)

> a big moving message board is a somewhat bigger deal than a
> few 7 segment displays though

It is. To reach each segment/LED in a reasonable time you need
micro I/O or other hardware. I have no problem using a small
PIC and hardware. I *could* pay several times the price of a
12F for an 18F, but my programming skills are up to making a
little one and a bit of cheap logic do the job just as well

2007\02\20@022730 by Rikard Bosnjakovic

picon face
On 2/19/07, peter green <.....plugwashKILLspamspam.....p10link.net> wrote:

> the normal way to achive this is to use a transistor (something like the good old 2n3904 or 2n3906 depending on if you want a NPN or PNP) to switch the common line of each display (since the common line will sometimes be carrying power for 7 segements at once its a bit much for a PIC IO line to drive directly) and then connecting the corresponding segements from each display together to PIC IO lines.

If I understand you correctly here, are you saying that all the
segments' inputs should be glued together at the PIC io-lines, and
another (two?) io-line controls the four transistors, each one connect
to one each segment, then looping around making only one transistor
active at a time?

In that case, nice. That's way more clever than the mux-solution I had in mind.


--
- Rikard.

2007\02\20@030111 by Jinx

face picon face
> If I understand you correctly here, are you saying that all the
> segments' inputs should be glued together at the PIC io-lines,
> and another (two?) io-line controls the four transistors, each
> one connect to one each segment, then looping around making
> only one transistor active at a time?

Each digit module has a common line, either common anode or
common cathode

Talking about just common cathode displays, which I think are
more, um, common, than common anode -

The "earthy" ends of the segments are joined together. Usually that
common line would be connected to ground and current is applied
to the "hot" side of each segment to make it light. If you have a look
at the pdf that Philip Coiner posted, you'll see that the displays are
common cathode

Multiplexing is one part of driving the display. The other part is
strobing, which is where the data is presented to the digit for its
pattern and then the cathode is grounded through a transistor to
make the selected segments light. After a time, maybe 10ms or
whatever the strobe rate is, that digit is turned off, and you present
pattern data to the next digit, ground the cathode, wait, and so on

There's more than one way to do this, but ultimately the effect
appears, because of persistence of vision and if the strobing is
fast enough, that the whole display is on. If there were 4 digits,
each one is on for actually on 1/4 of the cycle time

For common anode the "hot" side of the segments is commoned
and switched to V+, and current is sunk by the micro or logic
through the segment

2007\02\20@032549 by peter green

flavicon
face
> If I understand you correctly here, are you saying that all the
> segments' inputs should be glued together at the PIC io-lines, and
> another (two?) io-line controls the four transistors, each one connect
> to one each segment, then looping around making only one transistor
> active at a time?
yeah, thats pretty much it, i'd use a big enough PIC that i could afford to give each segement transistor a dedicated IO pin though.


2007\02\20@044700 by Alan B. Pearce

face picon face
>for a 6 digit system with normal sized displays used under household
>conditions i'd think a 330ohm series resistance (~10ma drive) would
>be perfectly bright enough, especially if you cover the displays with
>a filter (filters hugely increase your contrast ratio and make the
>display look nicer too, highly reccomended).

Don't forget that the PIC chips have a maximum current per chip and if doing
70mA (all segments on for an '8' with other current as well, you may be
exceeding either the current rating or the power dissipation.

2007\02\20@050456 by Marcel Birthelmer

picon face
There is also the MAX7221 chip that handles everything quite nicely,
with SPI addressing, and up to 8 digits of 7 digits + DP. It also has
optional BCD decoding (per digit), and a drive current that's
adjustable via an external resistor and then again via an internal
register. Quite nice.

Now of course, this is a Maxim chip (made from pure unobtainium) and
costs about $10 apiece, but if you're doing one-offs, you can sample
it from them and be fine. I'm trying to design it out of a hobby
project right now, but the alternatives are few and far between, and
doing it myself is a hassle as far as pin count and so forth goes.

2007\02\20@063023 by Forrest W Christian

flavicon
face
Rikard Bosnjakovic wrote:

>There is one thing that struck me. For my project, I'm going to have 5
>mechanical switches (or around there) and 3 dual 7-LED segments. Now,
>how do you professionals "think" in a scenario like this, where the
>microcontroller is supposed to control all switches and LEDs?
>  
>
Here's the way I would do it, to converve pins:

Multiplex the LEDS,   You need one output for each 7 segment digit - So
6.  This turns on that 7 segment display.  Call this "digit select" for
below.  Each of these will need either a 2n3904 or a 2n3906 depending on
whether the displays are common cathode or common anode - that is
whether the common pins need to be connected to the positive or negative
side of the circuit.

You also need either 7 or 8 outputs (depending on whether you care about
the decimal) to drive the segments. Call these "segment drive".  
Depending on the exact led you use, you may or may not need to
supplement the drive from the PIC with a transistor.   If you need to do
this, use the opposite transistor on each pin.

So total of 6+8=14 outputs for the LED display. If you are really
pin-constrained on the PIC you could possibly use a 3 to 8 decoder 74xx
series part to reduce the 6 multiplex outputs to 3, but I'd just use a
larger PIC.   See: http://www.melabs.com/resources/articles/ledart.htm ,
figure 6, and numerous other sites for examples of the circuit.

I would also considering multiplexing the buttons as well, using the
same 6 outputs you use to turn on the LEDS.  That is, tie one side of
all of the buttons to a single input pin.   Use a pullup or pulldown
resistor on that pin (depends on the polarity of the LED displays).  
Then hook each of the switches to one of the digit select outputs you
use to turn on one of the displays, through a diode to prevent problems
when two buttons are pressed at the same time.     Again, depends on how
many pins you have available.

The loop looks like this:

while (1)
{
  Set the segment drive outputs to light the appropriate segments for
the digit you want to read.
  Turn on digit select output
  Read input pin - store state of switch attached to current digit
select output.
  Delay for a while (1ms or so)
  Turn off digit select output.
}

If you're really bored, you could put this into an interrupt routine
which is triggered every 1ms by the timer.  In that case, you can just
remove the delay part, and move the turn off digit select to the first
of the routine, like:

digit_output_isr
{
  Turn off digit select output
  set the segment drive outputs for the next digit.
  turn on digit select output.
  read and store switch status.
}

You then have some "registers" in memory for each digit, which digit is
currently being displayed, and the status of all of the input bits.  To
update the display you just put the correct values in the registers, and
the display gets updated as the isr runs.  The input status also changes
automatically.   The other cool idea about this option would be to
increment/decrement the "clock" during each run, if the clock is running.

-forrest

2007\02\20@160755 by William Chops Westfield

face picon face

On Feb 20, 2007, at 3:30 AM, Forrest W Christian wrote:

> Multiplex the LEDS

I feel compelled to mention a design I'm working on now.  It has
a 24pin 4-digit display plunked now INSIDE the outline of a 40pin
PIC (one on top the PCB, one on the bottom), with the display pins
connected to the closest "convenient" (from a PCB layout point of
view) PIC pins.  I expect the firmware (as yet unwritten) to be an
interesting exercise.  I'll be driving somewhere between one segment
and one digit at a time.  Essentially, I'm using a 40pin PIC (~$1
for a 16F59) as a fancy display decoder; the details will be
invisible to the other PIC (or "whatever") that runs the main
application; this is a sort of serial front-panel...

No current limiting resistors, which is theoretically bad, but
something that people seem to get away with on a widespread basis.
Some of the power connections are routed across input pins (to
save PCB space), so I'll have to use them as input.  It's a work
of art in hw/sw "co-design",  in a sort of "controversial art" way.
It's an experiment.

I'm not suggesting that you do this.  But with chip pricing the
way it is, you REALLY might want to consider a micro with more
pins, rather than worrying too hard about how to fit more functions
onto fewer pins...

BillW

2007\02\20@174545 by Jinx

face picon face

> and one digit at a time.  Essentially, I'm using a 40pin PIC (~$1
> for a 16F59) as a fancy display decoder; the details will be

I hadn't realised there was a 40-pin so cheap. Thanks. I ought to
look around a bit more ;-)

2007\02\20@193825 by Byron A Jeff

face picon face
On Mon, Feb 19, 2007 at 10:53:53PM +0100, Rikard Bosnjakovic wrote:
> I'm still waiting for my PIC-programmer to arrive, but I cannot sit
> idle so I borrowed a couple of books at the library and started to
> read about PIC-assembler, PIC-layouts etc.

Excellent. There are also a couple of real good tutorials online. Take
a look at Nigel Goodwin's tutorial and John McDonald's Elmer160 tutorial.

> There is one thing that struck me. For my project, I'm going to have 5
> mechanical switches (or around there) and 3 dual 7-LED segments.

Quite a bit of hardware.

> Now,
> how do you professionals "think" in a scenario like this, where the
> microcontroller is supposed to control all switches and LEDs?

A combo of multiplexing and getting an appropriate sized PIC to handle
the job.

>
> What I mean is, the big PIC I saw had 4 tristate A-ports (A0-A3 IIRC)
> and 8 B-ports (B0-B7).

That's an 18 pin part. It's small in the scale of parts. It's one reason I
suggest to hobbyists to use either 28 or 40 pin parts.

> Given the fact that each LED-segment requires 7
> outputs, how would you design the circuit? Multiplexers between the
> PIC and the segments?

One cheap way to get quite a few outputs is to use a serial shift register.
Using a 74HC595 for example gets you 8 outputs for as few as 2 PIC I/O pins.

>  I'm still unskilled - practically - with
> mux'es, but there's never too late to learn.

It's almost always easier to upgrade the size of your PIC. A 28 pin PIC with
a full 8 bit PORTC would solve the problem nicely.

BAJ

2007\02\20@221949 by Rikard Bosnjakovic

picon face
On 2/21/07, Byron A Jeff <EraseMEbyronspam_OUTspamTakeThisOuTcc.gatech.edu> wrote:

> That's an 18 pin part. It's small in the scale of parts. It's one reason I
> suggest to hobbyists to use either 28 or 40 pin parts.

It probably shows nicely how unskilled I am in the uC-world when I
think 14 output-lines from a controller/processor is "a lot" ;-)

Thanks for the tip though, I will browse around for a PIC with a PORTC.


--
- Rikard.

2007\02\21@012912 by William Chops Westfield

face picon face

On Feb 20, 2007, at 2:45 PM, Jinx wrote:

>>  I'm using a 40pin PIC (~$1 for a 16F59)

> I hadn't realised there was a 40-pin so cheap.

I hadn't either.  It's not just a hypothetical "budgetary price",
either; Digikey wants $25 for 25 of them...

It's interesting that the 12-bit flash parts haven't gotten more
press...

BillW

2007\02\21@042314 by Alan B. Pearce

face picon face
>No current limiting resistors, which is theoretically bad, but
>something that people seem to get away with on a widespread basis.
>Some of the power connections are routed across input pins (to
>save PCB space), so I'll have to use them as input.  It's a work
>of art in hw/sw "co-design",  in a sort of "controversial art" way.
>It's an experiment.

I am doing something similar with a 16F628A and a 2 digit display. I have
two outputs as the anode drivers, and Port A as the segment drivers, with
one bit from port B as the DP drive (remember Port A bit 5 is MCLR, which is
input only). I am driving one segment at a time for 1mS per segment (giving
an 8% duty cycle), and each anode has a 33 ohm resistor. I did try having
the resistor value, but the display got no brighter, so I believe the output
transistors are no longer in saturation. The display is a bit dim, even with
a "high efficiency" display, so I may yet need to go to a later display with
more brightness at the current.

2007\02\21@081610 by Byron A Jeff

face picon face
On Wed, Feb 21, 2007 at 04:19:48AM +0100, Rikard Bosnjakovic wrote:
> On 2/21/07, Byron A Jeff <byronspamspam_OUTcc.gatech.edu> wrote:
>
> > That's an 18 pin part. It's small in the scale of parts. It's one reason I
> > suggest to hobbyists to use either 28 or 40 pin parts.
>
> It probably shows nicely how unskilled I am in the uC-world when I
> think 14 output-lines from a controller/processor is "a lot" ;-)
>
> Thanks for the tip though, I will browse around for a PIC with a PORTC.

Though it's a subject of some debate here, I think that you may even want to
consider a 40 pin part. With 3 full 8 bit ports and two partial ports, 40
pin PICs generally have enough I/O firepower for most tasks.

My next part to evaluate is the 16F887. As far as I can tell it seems to be
very close to a 40 pin version of the 16F88. Self programmable with the
nanowatt internal oscillator. Program it with a quick bootloader and you
have a self programmable part that needs no external parts to get going.
Also the nanowatt parts can reprogram the MCLR and CLK pins as I/O giving
an effective 36 I/O pin part in a 40 pin package.

BAJ

2007\02\21@085635 by Jan-Erik Söderholm

face picon face
Byron A Jeff wrote :

> My next part to evaluate is the 16F887. As far as I can tell
> it seems to be very close to a 40 pin version of the 16F88.

And the whole 16F88x series seems to be a nice "upgrade"
from the well-known 16F87x(A) series. Both as 28 and as
40 pin parts. One get more functionality for actualy a
*lower* cost/chip.

> reprogram the MCLR and CLK pins as I/O...

MCLR only as *input*, at least on other chips with
internal-MCLR capability...

Jan-Erik.



More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...