Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 8th April 2007, 11:05 PM   (permalink)
Default PIC16F84A + 4017 Decade Counter + audio question

Hi,

Quick Query:

The PIC16f84A has 5A + 8B = 13I/O pins, as if you all didnt know

Question:

If I were to connect a 4017 cmos decade counter to each output.. 13 (unless there are some pins which cant output.. yeah still havent understood which ones!!!)

Would I be able to control 13 x 10 = 130 LEDs individually!!!!!!!!!!!!????????

Would transistor be needed to increase brightness?

Thanks,
Peter Wadley
__________________
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post

9vDC Guitar Pedal PSU

PIC16F84a Game Module
Peter_wadley is offline   Reply With Quote
Old 8th April 2007, 11:48 PM   (permalink)
Default

With demultiplexers, 13 bits will get you 8191 individual outputs. Flip flops can toggle each one on or off.
__________________
C:\WHUT ?
Beware the asterisk *
ClydeCrashKop is offline   Reply With Quote
Old 9th April 2007, 12:14 AM   (permalink)
Default

Sorry, You lost me there..

Can you give me a good chip number please?

In the mean time I will go learn about demultiplexers and flip flops!

Can you try to explain these two types of chips in a tiny bit more detail?

Thanks alot!
__________________
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post

9vDC Guitar Pedal PSU

PIC16F84a Game Module
Peter_wadley is offline   Reply With Quote
Old 9th April 2007, 02:45 AM   (permalink)
Default

You'll want to mux the LEDs. One easy way would be be a transistor driver (you could use the 4017 with a UL2803 driver) to run 8 columns and a PIC 16F877 (lots of I/O) to drive the rows directly.

8x24 (total of 26 I/O pins) is 192 LEDs and that still leaves some I/O too. Also much less current than driving directly.

Toronto eh. Have you visited Creatron Inc on College? I'll be there this Thursday evening.

PS stop using the 16F84, there shoud be a campain...
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com

Last edited by blueroomelectronics; 9th April 2007 at 02:47 AM.
blueroomelectronics is offline   Reply With Quote
Old 9th April 2007, 02:57 AM   (permalink)
Default

The 4017 will only allow one LED to be on at a time per 4017.

If you want to be able to control the LEDs individually, use a Shift Register such as the 74HC164. It is an 8 bit serial in, parallel out SR. Note that you will need a common clock line (or a common data line) and individual data lines (or clock lines).

However, the advantage of the 74HC series is that it has 25 mA current source/sink capability which is adequate to drive ordinary LEDs.
__________________
Len
ljcox is offline   Reply With Quote
Old 9th April 2007, 03:12 AM   (permalink)
Default

Quote:
Originally Posted by ljcox
The 4017 will only allow one LED to be on at a time per 4017.

If you want to be able to control the LEDs individually, use a Shift Register such as the 74HC164. It is an 8 bit serial in, parallel out SR. Note that you will need a common clock line (or a common data line) and individual data lines (or clock lines).

However, the advantage of the 74HC series is that it has 25 mA current source/sink capability which is adequate to drive ordinary LEDs.
Are you suggesting using one 74HC164 (or 74HC595, etc.) SR for each set of 8 LEDs (100% duty cycle for each LED)?

I'm not sure a '164 would be a good choice because it doesn't use a 'latch' or 'strobe' control to transfer the contents of the shift register to the outputs. Any data shifted in will immediately show up on the outputs and this might make the display a little wierd during updates.

Last edited by Mike, K8LH; 9th April 2007 at 04:05 AM.
Mike, K8LH is offline   Reply With Quote
Old 9th April 2007, 10:30 AM   (permalink)
Default

Your idea will work fine. I found one circuit that uses a 74LS193, 4 bit counter feeding a 74LS154 demultiplexer that would give you 16 X 12 = 192. 74259 8 bit latches would be better than flip flops but forget that if you can keep updating the LEDs. You would need a bunch of them. I found another circuit that made a 10 X 10 LED scope using a 4017 counter and an LM3914N dot/bar display driver.
__________________
C:\WHUT ?
Beware the asterisk *
ClydeCrashKop is offline   Reply With Quote
Old 9th April 2007, 10:55 AM   (permalink)
Default

:@ My long reply was not posted!!!

Here is a short version:

PIC16F877 = too expensive for LED sequency project..

Id like to do this with my one of my PIC16F84As..

Ok, I only need to be able to individually controller 50 LEDS.. therefore at any given time I will be able to have 50 LEDS on..

My thought process was this..

Since the 4017 can handle 10 LEDS.. use 5 of them on rb0-rb4

and since the 4017 change there state with a high pulse edge I could control each LED by quickly cycling to the one I would like..

hmm but then I would only able to have 10 on -- one per 4017 at a time..

Can someone explain how the shift register would work?

Im going out to the store soon and would really like a couple chips numbers..

From what ive read I need 4x 74154 demux chips (64LEDs)

But wouldnt I need 5 pins for each DEMUX 1 = input 4 = selectors.

I wouldnt have enough pins..

I guess this where shift registers comes in .. :| ?

Again..
50 individually controlled LEDs that can be lit simultaneously

thanks, please remember that I am a still a noob when it comes to TTL control.
__________________
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post

9vDC Guitar Pedal PSU

PIC16F84a Game Module
Peter_wadley is offline   Reply With Quote
Old 9th April 2007, 11:01 AM   (permalink)
Default

Quote:
Originally Posted by Peter_wadley
Id like to do this with my one of my PIC16F84As..

Ok, I only need to be able to individually controller 50 LEDS.. therefore at any given time I will be able to have 50 LEDS on..
Dump the antique 16F84 and use a 16F628 instead (which is lots cheaper anyway), consult my tutorials and drive 64 LED's with no extra chips.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 9th April 2007, 11:15 AM   (permalink)
Default

Nigel,

You must be getting SO incredibly sick of seeing people still trying to make projects using the 84a hehe

You might as well just put it in your signature

I know exactly what you mean though. I cant wait to use these 3 chips up! They are great for learning but soon turn very annoying!

I cant wait to start using the 16F628 and 16F877.. A/D convert.. mouth drools

But still is there anyone that can help me with the 74154 1-16 demux?

Thanks
__________________
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post

9vDC Guitar Pedal PSU

PIC16F84a Game Module
Peter_wadley is offline   Reply With Quote
Old 9th April 2007, 11:34 AM   (permalink)
Default

I agree with the multiplexing suggestions. Not sure your '4017 is a good choice though.

Most multiplexing designs will power one column or row at a time while driving one or more of the LEDs in that column or row, respectively.

If we "scan" columns, duty cycle is inversely proportional to the number of columns (2 cols = 50% duty cycle, 4 cols = 25% duty cycle, 8 cols = 12.5% duty cycle, etc.). If an individual LED requires 10-ma current for full brightness at 100% duty cycle it's going to need 20-ma at 50% duty cycle, 40-ma at 25%, and 80-ma at 12.5% for full brightness. If you have an 8 x 8 matrix of multiplexed LEDs you'll have a 12.5% duty cycle and each column driver should be capable of supplying 640-ma when all 8 LEDs in that column are lighted. Each row driver needs to supply 80-ma for one LED at a time in each column.

Directly driving rows from PIC pins works well for one or two columns but the brightness starts to suffer as we add more columns. Use row drivers if you have more than a few columns and you need full brightness.


You can see we're using a lot of pins at this point so you might consider using a different driver IC with the common anode LED configuration. The Micrel MIC5821 or the pin-for-pin compatible Allegro A6821 is an 8-bit serial to parallel sinking driver with a 3 pin interface (Data, Clock, and Strobe). Here's a full brightness design that uses 9 I/O pins.



In this design PORTB is used as a column driver bus when the Strobe/OE pins are low (display on) and as a data bus to load the driver shift register when the Strobe/OE pins are high (display off). Simply blank the display at the beginning of each "scan" interrupt by taking Strobe/OE high, load new data into the SR, reset the PORTB column bus for the next column, and finally turn the display back on by taking Strobe/OE low. This only takes a few microseconds in the ISR.

You can also setup the PIC PWM module with a period equal to the column "scan" interval and drive the MIC5821 Strobe/OE pins directly from the PWM CCP1 pin output. You'll need a minimum PWM duty cycle of 5% or so to insure that you have time at the beginning of each interrupt cycle to load the SR while the display is off. Adjusting the PWM duty cycle from 5% to 100% will take the display from full brightness to black, respectively.

While these examples use 7-segment displays, I'm sure you realize you can use discrete LEDs or Bar/Graph LEDs or 8x8 matrix modules instead. And the "high performance" designs also scale up or down quite nicely.

Attached Images
File Type: png Mux CA & CC.PNG (43.6 KB, 90 views)
File Type: png Matrix Display (9 pin 7-seg).PNG (76.4 KB, 88 views)
File Type: png Matrix 8x8 (10).PNG (133.1 KB, 93 views)

Last edited by Mike, K8LH; 9th April 2007 at 12:29 PM.
Mike, K8LH is offline   Reply With Quote
Old 9th April 2007, 12:54 PM   (permalink)
Default

Peter,

I'm still not sure a '4017 or a '154 would be a good choice. Neither can be used to sink or source enough current to a multiplexed display without adding driver transistors and in the case of the '154 you really don't want to "scan" more than about 8 columns as the duty cycle is much too low and the pulse current requirements are way too high.

In all fairness I should mention that some of the direct drive low brightness designs might work well for your application too.


Last edited by Mike, K8LH; 9th April 2007 at 01:01 PM.
Mike, K8LH is offline   Reply With Quote
Old 9th April 2007, 01:25 PM   (permalink)
Default

Are you trying to do something like this to drive LED columns (common cathodes)?


I would maybe use the 74HC4017 to drive transistors for 8 columns but I'm not sure I could recommend using the 74HC154 to drive transistors for 16 columns for the reasons stated earlier (too low a duty cycle, too high pulse current requirements).

Good luck with your project. Mike
Attached Images
File Type: jpg Matrix Driver Concept 2.JPG (54.6 KB, 82 views)

Last edited by Mike, K8LH; 9th April 2007 at 01:30 PM.
Mike, K8LH is offline   Reply With Quote
Old 9th April 2007, 01:39 PM   (permalink)
Default

Nigel,

So by using your method in your last tutorial could I make a 5x5 LED arrangement work with my F84a? (A port sink 5 pins on the B port Sourcing?) other three B port pins can be used to cycle through patterns?

Sorry Mike your suggestion is a bit too technical considering I do not have any prior TTL education.. I would rather do it your way because I want to learn more about different chips and how they work together.. but I cant really get a grasp over what is happening..

PMW = errhm wah?
PFET driver.. :|
Strobe/OE pins.. :|
__________________
"Stick around" - Arnold Schwarzenegger in The Predator after impaling a soldier to a wood post

9vDC Guitar Pedal PSU

PIC16F84a Game Module
Peter_wadley is offline   Reply With Quote
Old 9th April 2007, 01:40 PM   (permalink)
Default

Quote:
Originally Posted by Peter_wadley
Nigel,

So by using your method in your last tutorial could I make a 5x5 LED arrangement work with my F84a? (A port sink 5 pins on the B port Sourcing?) other three B port pins can be used to cycle through patterns?
Yes, easily.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
4017 Decade counter markn Electronic Projects Design/Ideas/Reviews 19 30th July 2008 02:11 AM
Dual counter bananasiong Micro Controllers 45 24th March 2007 02:49 AM
How we can do it in Assembly..Help Needed Ayne Micro Controllers 37 29th December 2006 05:49 PM
Input Counter Pic16F84A (Code problems) loco Micro Controllers 4 26th September 2006 01:18 PM
16-step sequencer from two 4017 decade counters? october71 Electronic Projects Design/Ideas/Reviews 12 29th January 2004 09:11 AM



All times are GMT. The time now is 05:44 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.