Searching \ for '[PIC] Source Code for seven segment display' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Source Code for seven segment display'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Source Code for seven segment display'
2003\05\03@113328 by John Nall

flavicon
face
Would anyone be willing to share a bit of source code with me, for driving
three seven segment displays?  This is the next step after the "hello
world" stage of driving a single LED, and I'm not exactly sure where to
start.  Everything is breadboarded, and checks out manually.  So the next
step is to write the program.  (The object PIC is an 18F452, at either 10
MHZ or 40 MHZ, depending on whether or not I use the PLL).

I have googled for something, but most of the stuff available consists of
fairly complex applications, and I'm too new at this to be able to easily
separate out only the part I need. :-)

Thanks,
John

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\05\03@115023 by Dave VanHorn

flavicon
face
At 11:33 AM 5/3/2003 -0400, John Nall wrote:
>Would anyone be willing to share a bit of source code with me, for driving
>three seven segment displays?

One easy way to do this, is to use a lookup table.
Take the digit you want to display, if needed, convert it to binary 0-F
Using this value, index into a table that will return the proper bits set
as "1" to turn on the appropriate segments of the display.
Since there are seven segments, you can use just one byte.
In the PIC, this is something like a jump to an address plus an offset (the
index value) and the table consists of RETLW instructions that are a return
from subroutine, with the W register loaded with some value

Seg_Table:
        retlw   0x11111110
        retlw   0x00000110
        etc

or something like that anyway. :)
I'm the resident heretic, I use AVRs

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\05\03@120727 by Anand Dhuru

flavicon
face
This example uses PBP, but the superb write-up will give you an idea of how
its done anyway.

http://www.melabs.com/resources/articles/ledart.htm

Regards,

Anand Dhuru


{Original Message removed}

2003\05\03@121347 by Tim Box

flavicon
face
John

I have a routine to drive 5, 7 segment Leds. But unfortunately I 'am away
from the Office so I will forward when I get back. It's for the 18F452 1/2
Basic 1/2 ASM. Interrupt driven but the math's only take it up to about
24mhz before you have to change some of the precalars.

In the mean time look on the Melabs.com site under Articles. (I never found
it much good though)

Tim





{Original Message removed}

2003\05\03@141845 by John Nall

flavicon
face
At 09:37 PM 5/3/2003 +0530, Anand Dhuru wrote:

>This example uses PBP, but the superb write-up will give you an idea of how
>its done anyway.
>
>http://www.melabs.com/resources/articles/ledart.htm

It does indeed!  Very good article, and I appreciate the pointer to
it.  And thanks also (with this one reply) to the other writers who offered
advice.  All good, as usual.  :-)

John

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\05\03@144132 by Kevin Olalde

flavicon
face
You may want to try:

<http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_09Poglavlje.htm>

John Nall wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\05\03@144512 by Ben Jackson

flavicon
face
BTW, if you are buying (rather than salvaging) displays, I think the way
to go with the PIC is common cathode.  I bought some CA displays with
higher brightness/mA than the salvage ones I was prototyping with, and
they showed me that the PIC's Vhigh was not quite as high as the segment
selecting transistor was supplying to the common anode, causing "off"
segments to be ever so slightly on.  So I am now driving the lines with
TRISB instead of PORTB (to get low vs hi-z).  It's a little more work than
doing it the other way.

--
Ben Jackson
<spam_OUTbenTakeThisOuTspamben.com>
http://www.ben.com/

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...