PDA

View Full Version : led matrix pic 16f84 and 4017 help me please



Mus.me
- 11th July 2009, 03:53
im using led matrix 5x9 which has 5 anode and 9 cathode im pluging 9 cathode in 4017 5 anode in port a in pic 16f84 so i need help to pulsout portb.0 to the 4017 so i want to display text on the led matrix


example

porta = %10010
pulsout portb.0,150
pause 10
porta = %11001
pulsout portb.0,150
so on .......

i need help in pulsout plz or someone can post any example code here ,,?

mackrackit
- 12th July 2009, 07:23
I do not understand you question.

Do the LEDs light up as expected if PORTB.0 is made high?

Mus.me
- 12th July 2009, 23:52
I do not understand you question.

Do the LEDs light up as expected if PORTB.0 is made high?

i made led matrix 5 x 9 well im pluging the side which has 5 and the side which has 9 in 4017 decade counter ic and led matrix 5x9 which is 45 leds.and i did 5 cathodes and the 9 anoides, the ic 4017 it need pulsout i conected it to portb.0 the problem i have is i want to send 1 pulse to 4017 during porta feeding the 1st 5 cathodes leds then 2nd 5 leds 2nd pulse to 4017 so on ...bcz led matrix it has 9 lines of 5 leds so i can display scroling txt or anythings,i hope u inderstand and i will try t0 draw a schema ,,

Mus.me
- 13th July 2009, 02:14
This is the schematic,i need help how to drive this ti write scroling text ,thank u

mackrackit
- 13th July 2009, 05:38
I do not think the pulsout command is going to work for you, maybe a series of them?

This may help you.
http://delabs-circuits.com/cirdir/theory/gates/doc00020.html

Archangel
- 13th July 2009, 06:03
Hello Mus.me,
Here is basically what you do, get some graph paper, lay out 5x9 squares on the paper, and create the characters you want to display. The sides will have a binary value. I use the Port side (the PIC side) as the port output value. I use 8x8 displays as it is easier. the character " 0 " would be comprised of a row value $7e, followed by 3 rows of $81 and finally $7e again. Make up 5 lookup tables which execute sequentally and put the 5 bytes of each character in each. That's how to do it.

Darrel Taylor
- 13th July 2009, 11:17
If that's a CD4017, then it can only source about 0.36 ma @ 5V. That's not enough to drive 1 LED, let alone 5.

If it's a 74HC4017, then it can drive 25 ma. Good enough for 1, maybe 2 LED's, or 5 DIM ones.

Some transistors or darlingtons would help.
You might want some resistors in series with the 5 cathodes too.
<br>

Mus.me
- 14th July 2009, 00:39
If that's a CD4017, then it can only source about 0.36 ma @ 5V. That's not enough to drive 1 LED, let alone 5.

If it's a 74HC4017, then it can drive 25 ma. Good enough for 1, maybe 2 LED's, or 5 DIM ones.

Some transistors or darlingtons would help.
You might want some resistors in series with the 5 cathodes too.
<br>thank u for reply i know that ,but i wanted to know how i write the pulse to 4017 ,i will change the schematic and i take off tc4017 and i use 8x5 led matrix it will be easy to drive anyway thank you Darrel Taylor & joe S & Mackrackit for helping me .

Darrel Taylor
- 14th July 2009, 07:15
... ,but i wanted to know how i write the pulse to 4017 ...
OK, so let's take a look at the PULSOUT command.
There's really nothing wrong with your original statement, which is why we were avoiding the question.
pulsout portb.0,150
The pulsout line above will toggle the pin twice, giving an effective "Pulse". The 4017 will count on the "Rising Edge" of the pulse.
The time between the Toggles would be 150 * 10us = 1500us = 1.5ms. (assuming 4mhz OSC)

1.5ms is extremely long for this purpose. But it would still work.
pulsout portb.0,1 with a 10us pulse would work just as well.
However, the 4017's can take a pulse width as small as 100ns (.1us) so you don't really need PULSOUT.
Simply toggling the pin with HIGH and LOW will do the job too.
HIGH PORTB.0
LOW PORTB.0

Another thing to do is turn OFF all LED's before the pulse. Otherwise the 5 LED pattern will briefly show on 2 rows, giving a ghosting effect.

PORTA = %11111 ; ALL LED's OFF
HIGH PORTB.0
LOW PORTB.0
porta = %10010 ; new pattern


Cheers,

Mus.me
- 16th July 2009, 00:49
thank u Darrel Taylor for helping me,i have another quetion, i,m using proteus 7.5, for testing my project but it seems not working good is there any other programe to test projects?

mackrackit
- 16th July 2009, 01:53
What would be wrong with doing it the old fashion way?

A bread board, some wires and parts. Then the only thing
to worry about maybe is some stray capacitance.

Archangel
- 16th July 2009, 05:17
. . . . . .my project but it seems not working good is there any other programe to test projects?

Hello Mus.me,
The " code snippet" you posted . . . is that all of it or is there more? I ask because you made no mention of TRISA or TRISB, and those registers tell the PIC to make the ports inputs or outputs, also check your data sheet for that PIC because most of this series have open collector outputs on PortA.4 . I do not see config statements or OSC Define either.

Mus.me
- 16th July 2009, 14:39
Hello Mus.me,
The " code snippet" you posted . . . is that all of it or is there more? I ask because you made no mention of TRISA or TRISB, and those registers tell the PIC to make the ports inputs or outputs, also check your data sheet for that PIC because most of this series have open collector outputs on PortA.4 . I do not see config statements or OSC Define either.ok joe in know to how to config them i think

define osc 4
porta = 0
trisa = 0
portb = 0

i did everythings but to debug in protues it doesnt work good ex: porta.0 isnt sending data out in proteus so im lookin if there is any other software like proteus to debug my code ,ICD doesnt include f84 and many PICs,i did pic simulator but i didnt understand it so proteus is easy but it seems not doing good job and very slow ,thank u joe for helping me ..

wellyboot
- 18th July 2009, 20:45
define osc 4
porta = 0
trisa = 0
portb = 0


this as well:
trisb = 0



porta = %10010
pulsout portb.0,150
pause 10
porta = %11001
pulsout portb.0,150
so on .......



Maybe worth changing the 'pause 10' to 'pause 1' if your display is flickering.

does your 4mhz crystal have 2 caps (18 - 22pf) between each leg and ground?
not shown on your diagram.

Mus.me
- 20th July 2009, 01:18
this as well:
trisb = 0




Maybe worth changing the 'pause 10' to 'pause 1' if your display is flickering.

does your 4mhz crystal have 2 caps (18 - 22pf) between each leg and ground?
not shown on your diagram.thank u wellyboot for explaining, and thanks everyone trying to help ,,, i will do it and i post the result ........

xxxxxx
- 5th February 2011, 00:06
hello to everbody...so i tried to play a little with a 5x7 dotmatrix and 4017 whitch is driving the columns, the problem is that when i power down my circuit and power it up the scroll is not starting from first colum, sometimes it does, but i must to reset circuit a several times there is no clear pattern for this and the leters start to mix up, eny idea how to solwe this???


edited:

I realized that I can use the free pin uC to reset 4017