Last edited by Mus.me; - 14th July 2009 at 00:55.
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.The pulsout line above will toggle the pin twice, giving an effective "Pulse". The 4017 will count on the "Rising Edge" of the pulse.Code:pulsout portb.0,150
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.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.Code:HIGH PORTB.0 LOW PORTB.0Cheers,Code:PORTA = %11111 ; ALL LED's OFF HIGH PORTB.0 LOW PORTB.0 porta = %10010 ; new pattern
DT
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?
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.
Dave
Always wear safety glasses while programming.
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.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
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 ..
Last edited by Mus.me; - 16th July 2009 at 15:12.
this as well:define osc 4
porta = 0
trisa = 0
portb = 0
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.
Last edited by wellyboot; - 18th July 2009 at 20:49. Reason: missed something
Some of my projects: http://www.youtube.com/user/wellyb00t
Bookmarks