I need a program for PIC18f4520...

Status
Not open for further replies.

mohideen

Member level 2
Joined
Jan 19, 2011
Messages
45
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,580
Hi all,
I am asked to count from 00-99 in the 7 segment led...
I need a program for this function...
Thanks.
 

with 74HC595 (see datasheet for pinout)


Your Config,Picmicro,var,etc....
;
Dim chif1 as byte
Dim chif2 as byte
dim 7seg1 as byte
dim 7seg2 as byte
dim x as byte

Data var PORTX.X
Clock var PORTX.X
Latch var PORTX.X


SHOut Data,Clock,msbfirst,[0,0,0] ' clear
PulsOut Latch,1
DelayMS 1
PulsOut Latch,1
DelayMS 1


MAIN:
For x = 0 To 99
chif1 = Dig temp ,1
chif2 = Dig temp ,2
7seg1 = LookUp chif1 , [63,6,91,79,102,109,125,7,127,111]
7seg2 = LookUp chif2 , [63,6,91,79,102,109,125,7,127,111]
SHOut Data,Clock,msbfirst,[7seg2,7seg1]
PulsOut Latch,1
DelayMS 1
PulsOut Latch,1
DelayMS 100
Next
GoTo Main

;******************
;latch = pin12 on HC595
;clock = pin11 " "
;data = pin14 " "
;******************
hope this help :grin:
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…