Counter using EB008 Quad 7Seg Display

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Counter using EB008 Quad 7Seg Display

Postby medelec35 » Thu Oct 21, 2010 2:25 pm

I received a EB008 Eblock today, So I decided to created an application that can be used for batch counting or other counting applications. (Flowcode V4)
With EB008 plugged into port A and B. Portc 0 is trigger and portc1 is reset.
Counter increments one at a time from 0 to 9999 with no flickering each time C0 goes high then low, and stops at 9999.
This Flowchart can convert any variable from 0 to 9999,direct to the quad 7seg display.
Other apps can include a stop watch, clock, display for voltages etc.
Uses a total of 12 pins which includes a decimal point.

Using timer0 to refresh display so if delays, key detections etc used, then refresh rate will stay the same.
Tested on 18F4455.
Not used the pll function of 18F4455 (chip is running at 19.66MHz and not 48MHz), so LED refresh speed will not change if using a different target with EB006 programmer and 19.66 MHz xtal.
Attachments
7Seg_ Batch Counter 18F4455.fcf
(16.5 KiB) Downloaded 295 times
These users thanked the author medelec35 for the post:
Benj (Thu Oct 21, 2010 4:51 pm)
Rating: 5.56%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Re: Counter using EB008 Quad 7Seg Display

Postby medelec35 » Sat Oct 23, 2010 4:36 pm

The above version is using a mixture of strings, Bytes and integers.
Here is another version (Flowcode V4) which is only using bytes and integers so takes up less room: used:1004 bytes
Where as the version in above post: used:2962 bytes
The difference between this and other counters posted is these versions can count up or down. You can assign the count variable any number from 0 to 9999 and that will be displayed.
Other versions using the format:
SEG0 = SEG0 + 1
If SEG0 >= 10 then SEG0 = 0: SEG1 = SEG1 + 1 etc
are not suitable if you want to display any number directly from a variable.
If anyone is intrested in using 7seg LED displays, or having problems with applications using quad 7seg dislays, then reply to this post with your flowchart (V3 or V4 stating version used), then I will hopfully be able to help to get your project working.
Attachments
7Seg_ Batch Counter 18F4455 V2.fcf
(11.5 KiB) Downloaded 303 times
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.