CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

how to make aprogram to show 0-99 on seven segment display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mmdcet



Joined: 07 Jan 2013
Posts: 2

View user's profile Send private message

how to make aprogram to show 0-99 on seven segment display
PostPosted: Mon Jan 07, 2013 4:24 am     Reply with quote

hello everybody
i am new to pic programming. i want to make a program to count from 0 to 99 unsing pic16f877a and 7segment display. can any body tell me the code. i tried a code of my own but it was too lengthy.
_________________
£aBiVa
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Mon Jan 07, 2013 4:35 am     Reply with quote

Look, seriously, think...

0 to 99. One line of code a for loop.

The hard part is the display itself, and this is not generic. A 'seven segment' display, can immediately be common cathode or common anode. Two different connection patterns, while the digit output will depend totally on the connections _you_ choose. The display can also be static or multiplexed. A total of _billions_ of total combinations possible....
If you search the forum, you will find threads about how to drive seven segment displays, including how to make the code easier with lookup tables for the bits to be driven, and using a timer interrupt if the display is multiplexed. Find one of these that is close to your hardware, and either modify it to match your hardware, or modify your hardware to match it.
Once you have the display going, then add the line to count.

There is no 'generic' solution to this.

Best Wishes
Zloi



Joined: 26 Oct 2012
Posts: 11
Location: Croatia

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 3:52 am     Reply with quote

Sneak peek example EX_LED.C

Could be useful to you.

BR
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group