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 support@ccsinfo.com

Need help for Seven segment display

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



Joined: 27 Aug 2008
Posts: 7

View user's profile Send private message

Need help for Seven segment display
PostPosted: Tue Jul 28, 2009 9:17 pm     Reply with quote

Hi,

I am using PIC 16f873A controller. In that project I want to display float value in 4 digit seven segment LED display. The data lines (a to g) of the seven segment display is on port B1 to B7, and dot point (DP) at C0. Can anybody help for me?

Thanks in advance.

Regards,
Essakki.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 29, 2009 1:56 pm     Reply with quote

Read Ttelmah's comments about using an LED driver chip instead of a
using the PIC's i/o pins to drive the segments:
http://www.ccsinfo.com/forum/viewtopic.php?t=19497

With regard to how to generate the segment codes, look in this example file:
Quote:
c:\program files\picc\examples\ex_zmd.c

This file doesn't directly connect the LED segments to the PIC.
It uses a 74595 serial-to-parallel converter chip. The program
writes to the 74595, when it wants to display a number of the
7-segment display.

However, the Ex_zmd.c code does show how to create a character
table for the 7-segment digits. That program uses a 3-digit display.

Look in the lcd_putd() function in Ex_zmd.c. That's the main function
that displays numbers on the 3-digit LED display. For some reason,
it's called "lcd"_putd(), instead of led_putd(). Don't worry about that.
You can use most of the code in lcd_putd(), except that, at the end,
don't call the 74595 routine. Don't do this:
Quote:
write_expanded_outputs(&digits[0]);
output_low(EXP_OUT_ENABLE);

Instead, just write the digits[0] value to the port. You may have to
shift the data to get it to fit your pin layout on your port.
Guest








PostPosted: Thu Jul 30, 2009 9:33 pm     Reply with quote

I have an operational display that has 5 segment running on a 16f818 using 5 x 0.8 inch led segments (LDS-A814RI). It's bright and only consists of a CPU a few NPNs and resistors.

The CPU is used as the stand alone driver for the display. SPI is used to communicate from the main CPU.

There is a one drawback. You will have to do is adjust the brightness depending on the digit, because there is small brightness difference between the digits 1 and 8. Just use the CCP to adjust the LED PWM time and hardware SPI for coms and run it as fast as you can on the internal RC.

It works great.
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