Seven segment common cathode

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Seven segment common cathode

Post by oookey »

Hi :D

i'm trying to make a clock display using one unit 4pcs of seven segment, 2 digits for hours the rest for minutes, and using decimal point as second. Program on a 16F628A chip.
I got a problem that the FC component macro is for common anode only, but i have in hand is a common cathode :? , is there a way to change the component macro to suit common cathode :?:

Thanks for advice.

oookey

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seven segment common cathode

Post by medelec35 »

Hi oookey,
If you're still using Flowcode V3, then I Don't believe this is possible by using either 7Seg1or 7Seg4 LED components. If that was the case you can download free version of Flowcode V5 from here:
http://www.matrixmultimedia.com/lc_index.php?p=25
16F628A is included as a chip built in to the free version.
Here are the restrictions in the free version of Flowcode:

Code: Select all

Nag Screen                         : Always (5 seconds, startup and close down)
Icon count per macro               : 16
Macros per project                 : 4
C code lines per C icon            : 4
C code lines for suplementary code : 4
Vnet                               : Disabled
ICD                                : Disabled
Customise component code           : Disabled
Components                         : LEDarray, LED, LED7Seg1, LED7Seg4, LCD, Switch, Switchbank, ADC, Keypad, PWM, FormulaFlowcode, MIAC
Allowed chips (PIC_8)              : 16F84A, 16F628A, 16F690, 16F88, 16F877A, 16F887, 16F1937, 18F4431, 18F2220, Formula Flowcode Buggy, ECIO-40, ECIO-28, MIAC, Locktronics PIC
However If your using Flowcode V4 or V5 then changing from common anode to common cathode is only available with 7se1and not 7Seg4 component.
To do that just drag each component onto the panel, right click Ext Properties then choose common anode or common cathode. (Default is common anode).

Martin
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seven segment common cathode

Post by oookey »

Hi :) ,

I’m trying to use FC to control the common cathode seven segment (7seg4), prior hopping into the clock program.
Please take a look the V3 FC and advice. I tried to display 0 thru 9 by each of the 7seg4, using supplementary code and C, but fail to compile, error (57). :x

Thanks

oookey
Attachments
FailCompile.png
(25.87 KiB) Downloaded 3228 times
TRY7SEG.fcf
(7.5 KiB) Downloaded 314 times
ckt.pdf
(54.69 KiB) Downloaded 320 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Seven segment common cathode

Post by medelec35 »

Hi oookey,

Within suplementry code you have got:

Code: Select all

char num[] = {
63, 6, 91, 79, 102, 109, 124, 7, 127, 103}; //
0,  1,  2,  3,  4,  5,   6,   7, 8,   9,     
I believe you wanted to comment out:

Code: Select all

 0,  1,  2,  3,  4,  5,   6,   7, 8, 9 
if you want the commented numbers on the next line down then the two forward slashes have to be placed first:

Code: Select all

char num[] = {
63, 6, 91, 79, 102, 109, 124, 7, 127, 103}; 
// 0,  1,  2,  3,  4,  5,   6,   7, 8, 9  

Or

Code: Select all

rom char* num = {
63, 6, 91, 79, 102, 109, 124, 7, 127, 103}; 
// 0,  1,  2,  3,  4,  5,   6,   7, 8, 9     


Or same line:

Code: Select all

rom char* num = {
63, 6, 91, 79, 102, 109, 124, 7, 127, 103}; // 0,  1,  2,  3,  4,  5,   6,   7, 8, 9     



Martin
Martin

oookey
Posts: 42
Joined: Thu Mar 08, 2012 3:00 pm
Has thanked: 17 times
Contact:

Re: Seven segment common cathode

Post by oookey »

Hi everyone, :)

I got stuck using C code to display 7-segment. :(

It worked for display 7-segment when used none C code to program.
The pdf shows the images of the 7-segment display of both C code and none C code programs.

Please any advice?
oookey
Attachments
4x7SevenSegmentDisplay.fcf
None C code program
(21.21 KiB) Downloaded 308 times
UseCcodeToDisplay7Segment.fcf
C code program
(6 KiB) Downloaded 311 times
7SegmentDisplay.pdf
7 segment images
(236.39 KiB) Downloaded 344 times

Post Reply