| Swordfish Library - 7 Segment Display (Multiple) |
|
|
| Saturday, 04 April 2009 07:46 | |
|
Library Downloads for this tutorial
Pre-Notes:
For a brief overview on how a 7 segment display works, see the single 7 segment display example. Controlling multiple displays does add a new challenge to the situation, specifically the pin count required.
Note the PIC's power supply/oscillator are not shown
Device = 18F452 Clock = 20 #option Segments = 2 #option Segment_Port = PORTC #option Segment_1 = PORTD.4 #option Segment_2 = PORTD.5 #option DisplayInterval = 15 Include "7Seg.bas" Dim Variable As Word Variable = 0 While True DelayMS(1000) Inc(Variable) SegDisplay.Update(Variable) Wend
It is very user customizable, and can be used with single and multiple (up to 4) segment displays. Even the interval (multiplexing) speed can be modified to compensate for brightness and flickering issues due to different clock speeds. That said, the default settings allow for normal operation between 10Mhz - 20Mhz without the need to change many settings at all.
#option Segment_Port = PORTC // Segment Output Data Pins #option Segment_1 = PORTD.0 // Segment 1 Common Control Pin #option Segment_2 = PORTD.1 // Segment 2 Common Control Pin #option Segment_3 = PORTD.2 // Segment 3 Common Control Pin #option Segment_4 = PORTD.3 // Segment 4 Common Control Pin #option Segments = 4 // Number of Segment Displays in use (1 to 4) #option SingleDisplayRefreshTime = 500 // For use with single segment display #option DisplayInterval = 10 // Time that each display remains on for It should be noted that SingleDisplayRefreshTime is only for use when a single segment is used. It determines how long between update intervals for data to be displayed on the display, where as DisplayInterval is controls the time that each segment remains on while multiplexing with 2 or more displays.
Single Segment Display (link)
2 Segment Displays
4 Segment Displays
|
|
| Last Updated ( Friday, 24 April 2009 10:49 ) |
Whos Online
- dha
- ta1dr
- Jon Chandler
Forum Activity
Credit Where Credit's Due - jon chandler Tuesday, 16 March 2010 12:01 - [9 replies]
Marching LEDs - mrdeb Saturday, 13 March 2010 22:54 - [7 replies]
USB 8 Channel Servo Controller - andyo Saturday, 13 March 2010 01:19 - [2 replies]
Dedicated Servo Controller - graham Friday, 12 March 2010 17:58 - [0 replies]
Must have....delta temperature glowies! - graham Friday, 12 March 2010 17:31 - [3 replies]
A 'throw-away" PIC board - jon chandler Friday, 12 March 2010 13:41 - [31 replies]
iHID - graham Friday, 12 March 2010 02:04 - [5 replies]






Gamers ought to know link:http://www.buyazugagold.com [azuga gold[/u...]
Graham, Thanks for fixing the spacing on the array. This is how i...
Thanks Graham, It is a problem with Flowcode because the demo wa...
Looks like you've pretty much solved every minor issue that was enc...
The low-cost servo does have one other feature. The origina...
I am not familiar with flowcode, though did you try powering the bo...
Hello there, I am still trying to get the LCD to work but I am pro...
Hi Hop, I've finally got some time this weekend to delve into the ...