Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top