View previous topic :: View next topic |
Author |
Message |
esakki
Joined: 27 Aug 2008 Posts: 7
|
Need help for Seven segment display |
Posted: Tue Jul 28, 2009 9:17 pm |
|
|
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
|
|
Posted: Wed Jul 29, 2009 1:56 pm |
|
|
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
|
|
Posted: Thu Jul 30, 2009 9:33 pm |
|
|
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. |
|
|
|