Modify single 7 Segment LED

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

sptcarl
Flowcode V4 User
Posts: 34
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times
Contact:

Modify single 7 Segment LED

Postby sptcarl » Wed Feb 03, 2016 10:54 pm

I have never modified a component so wouldn't know where to begin, but is it possible to modify the LED display so that I do not have to specify connections for pin7 (DP) and Pin8 (Common)
I was hoping I could leave them assigned as Unconnected, but of course it will not compile. Because the project I'm working on is to upgrade software on existing PCBs, then hardware redesign is not an option.

Thanks in advance for any help offered. Carl.

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

Re: Modify single 7 Segment LED

Postby medelec35 » Wed Feb 03, 2016 11:14 pm

Hi Carl,
Problem is common and DP are required.
If DP are all assigned to an unused pin then all the DP's will be on instead of off.
Common is vital for the working of 7seg.
If no common is connected of a 7seg then that 7seg will not work at all.
So not sure why would not want to connect a common?

Unless I have misunderstood?

Perhaps a circuit diagram of your hardware may help?

Martin
Martin

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

sptcarl
Flowcode V4 User
Posts: 34
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times
Contact:

Re: Modify single 7 Segment LED

Postby sptcarl » Wed Feb 03, 2016 11:45 pm

Hi Martin,
Thanks for the quick reply.
The circuit board connects to 1 single 7 segment display whose common anode is permanently connected to the +VE supply rail, so no microprocessor control is required for the common.
The DP of the display is not connected to anything as it is not used.

It is the connection properties of the 7 seg LED component within Flowcode that I would like to be able to modify.

Thanks, Carl.

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: Modify single 7 Segment LED

Postby STibor » Thu Feb 04, 2016 6:48 am

Hello!

Without component.
Attachments
seg_7_man.fcfx
(13.69 KiB) Downloaded 138 times
These users thanked the author STibor for the post (total 2):
medelec35 (Thu Feb 04, 2016 1:12 pm) • sptcarl (Thu Feb 04, 2016 2:39 pm)
Rating: 10%
 

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

Re: Modify single 7 Segment LED

Postby medelec35 » Thu Feb 04, 2016 1:07 pm

sptcarl wrote:The circuit board connects to 1 single 7 segment display whose common anode is permanently connected to the +VE supply rail, so no microprocessor control is required for the common.

Oh right.
In that case does your microcontroller on your hardware have an unused pin?
If so can assign common and dp to them.
Or you could try the Flowchart STibor posted.

Martin
Martin

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

sptcarl
Flowcode V4 User
Posts: 34
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times
Contact:

Re: Modify single 7 Segment LED

Postby sptcarl » Thu Feb 04, 2016 2:38 pm

Hi Martin,
No there are no unused pins to connect them to (that's how I have got around it in the past with other projects).
I could be wrong, but I was certain that back in Flowcode V3, there was no common connection for the LED display, so I was assuming that it would be easy to get rid of it now with a bit of editing. To be honest it does seem a bit pointless and a waste of resources having to assign a pin to control a single display which is not multiplexed.

Anyway...

I hadn't even thought of STibr's method, yet it is such a simple solution and for that I give thanks.

Cheers guys. Carl.

User avatar
Benj
Matrix Staff
Posts: 14671
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4655 times
Been thanked: 4277 times
Contact:

Re: Modify single 7 Segment LED

Postby Benj » Thu Feb 04, 2016 3:10 pm

To be honest it does seem a bit pointless and a waste of resources having to assign a pin to control a single display which is not multiplexed.


I will see if I can make the common pin optional via a property.
These users thanked the author Benj for the post:
sptcarl (Thu Feb 04, 2016 3:27 pm)
Rating: 5%
 

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: Modify single 7 Segment LED

Postby STibor » Thu Feb 04, 2016 5:52 pm

This example is simpler than the previous one.
An example includes two variable arrays. Common anode or common cathode display.
Previous examples can be problematic (stack owerflow) interruption.
Attachments
seg_7_man_2.fcfx
(19.84 KiB) Downloaded 127 times
These users thanked the author STibor for the post:
Benj (Thu Feb 04, 2016 7:05 pm)
Rating: 5%
 

User avatar
Benj
Matrix Staff
Posts: 14671
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4655 times
Been thanked: 4277 times
Contact:

Re: Modify single 7 Segment LED

Postby Benj » Thu Feb 04, 2016 7:02 pm

Hello,

Here is a version of the component with a optional common pin which should also hopefully perform better with the simulation.

led_7seg_single.fcpx
(12.36 KiB) Downloaded 129 times


Let me know how you get on if you give it a go.
These users thanked the author Benj for the post:
STibor (Thu Feb 04, 2016 7:21 pm)
Rating: 5%
 

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: Modify single 7 Segment LED

Postby STibor » Thu Feb 04, 2016 7:34 pm

Hello!
Clear digits macros will not work?
If there is no common inputs, you can not negated the common input output.

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

Re: Modify single 7 Segment LED

Postby medelec35 » Thu Feb 04, 2016 7:42 pm

STibor wrote:Clear digits macros will not work?

They do with the latest update Ben posted above.
With that update you can select Yes or No for a Common Pin option.
Perhaps you have not over written original file with the updated one?
Martin

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

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: Modify single 7 Segment LED

Postby STibor » Thu Feb 04, 2016 8:28 pm

Simulation image attached.
Attachments
7seg_new.pdf
(210.26 KiB) Downloaded 185 times
seg_7_new_nocompin.fcfx
(4.88 KiB) Downloaded 94 times

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

Re: Modify single 7 Segment LED

Postby medelec35 » Thu Feb 04, 2016 9:57 pm

Hmm thats odd.
I was basing my comment on the attached flowchart in which clear digit does work fine.
Attachments
Multiple 7Seg Example3_v6.fcfx
(11.6 KiB) Downloaded 95 times
Martin

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

User avatar
Benj
Matrix Staff
Posts: 14671
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4655 times
Been thanked: 4277 times
Contact:

Re: Modify single 7 Segment LED

Postby Benj » Mon Feb 08, 2016 12:11 pm

Hello,

Right this should hopefully improve things and allow the clear digit to function correctly.
Attachments
led_7seg_single.fcpx
(12.42 KiB) Downloaded 82 times
These users thanked the author Benj for the post:
medelec35 (Mon Feb 08, 2016 12:22 pm)
Rating: 5%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: Modify single 7 Segment LED

Postby George_B » Thu Feb 11, 2016 8:32 am

Hello, i was trying to display characters like "C" , "A", "n" using output component and by setting equivalent pins Hi or Low. It is very weird that in FC4 this works fine but not in FC6!
Attached pictures show the FC4 components and the connections of the 7seg display in order to display character "o" (works fine).

Using Output component to obtain a characters on a 7seg display seems to have some issues in FC6 or am i doing something wrong?


Thanks
George
Attachments
CommonAnode.png
CommonAnode.png (4.65 KiB) Viewed 5199 times
Connection 7-Seg.png
Connection 7-Seg.png (31.18 KiB) Viewed 5199 times

User avatar
Benj
Matrix Staff
Posts: 14671
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4655 times
Been thanked: 4277 times
Contact:

Re: Modify single 7 Segment LED

Postby Benj » Thu Feb 11, 2016 1:31 pm

Hi George,

It should be working ok in v6. Can you attach your v6 program so we can take a look for you.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: Modify single 7 Segment LED

Postby George_B » Thu Feb 11, 2016 2:18 pm

Hi Benj,

you can find attached the FC6 file with a simple program showing letter "o" and after 1 sec the letter "F".
Attachments
7seg_CA_Output.fcfx
(5.82 KiB) Downloaded 91 times

User avatar
Benj
Matrix Staff
Posts: 14671
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4655 times
Been thanked: 4277 times
Contact:

Re: Modify single 7 Segment LED

Postby Benj » Thu Feb 11, 2016 3:21 pm

Hi George,

Thanks for the file,

Using Output component to obtain a characters on a 7seg display seems to have some issues in FC6 or am i doing something wrong?


Can you explain what issues your having in v6, it seems to be working correctly for me.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: Modify single 7 Segment LED

Postby George_B » Thu Feb 11, 2016 6:14 pm

Hi Benj , thanks for your attention and your help.

when you simulated the attached program, did you get a proper 'o' letter and after one second a proper 'F' letter and so on?

I think the issue that i am facing in FC6 is that the output state of the pins does not change with the "ClearDigit" component command.

In other words segments equivalent to letter 'o' (C,D,E,G) and segments equivalent to letter 'F' (A,E,F,G) are all light up simultaneously and therefore the result on the 7 seg display is always '6' which means segments A,C,D,E,F and G is always LOW (if we suppose that our Segment is Common Anode as is in the attached file).

If i am not very clear please let me know and i will try to explain with a different approach.


Thank you
George

sptcarl
Flowcode V4 User
Posts: 34
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times
Contact:

Re: Modify single 7 Segment LED

Postby sptcarl » Fri Feb 12, 2016 5:10 pm

Wow this has moved on a bit since I was last on here!
Ben, I used your original modified component and it worked fine (I didn't need the clear digit part, although it would still be nice to have the DP connection as optional). I will try your latest one when I get chance.

I might be mistaken George_b but I'm sure someone once edited the display component to allow It to display a range of letters.
I never realised until the other day that the 7SEG also displays the hex values of 10 to 15, I always assumed it went blank with values above 9!

Ben, Martin and STibor, thanks for your help.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: Modify single 7 Segment LED

Postby George_B » Sun Feb 14, 2016 11:26 am

Hello, after some testing with 7seg component on hardware, i found that in order to display a custom character correctly you have to define the status for all segments using output component. For example if we want to display letter 'C' (on a common anode 7seg display), we simply use the output component as follows:

1. Output component to enable common pin(HI)
2. Output component to set A segment (Low)
3. Output component to set B segment( Hi)
4. Output component to set C segment (Hi)
5. Output component to set D segment (Low)
6. Output component to srt E segment (Low)
7. Output component to set F segment (Low)
8. Output component to set G segment (Hi)
9. Output component to set DP segment (Hi)

I hope this helps anyone that will come across this.

Thank you all for help.