Shift Register 74HC595

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

Moderator: Benj

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

Shift Register 74HC595

Postby Derrihj » Mon Jan 27, 2020 11:36 pm

Hi guys yet again another tricky guy here "The famous SIPO (Serial-In-Parallel-Out) shift register" 74HC595,how do we use this in flowcode for PIC,i like to learn about it in flowcode coz it comes in-handy for low I/O pin count MCUs like my favourite the PIC12F683 if i want to drive a 3 digit 7 segment display with only 3 or 2 pins?

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

Re: Shift Register 74HC595

Postby medelec35 » Tue Jan 28, 2020 10:54 am

HI Derrihj,
I posted about 74HC595 in the Programming Tips & Tricks section here
As it was some time ago, flowchart was created with Flowcode V5.
Attached if the file converted to V7/V8.
Attachments
74HC595 V2.fcfx
(17.58 KiB) Downloaded 40 times
These users thanked the author medelec35 for the post (total 3):
Benj (Tue Jan 28, 2020 10:57 am) • Derrihj (Tue Jan 28, 2020 3:16 pm) • jgu1 (Tue Jan 28, 2020 7:19 pm)
Rating: 15%
 
Martin

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

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

Re: Shift Register 74HC595

Postby Benj » Tue Jan 28, 2020 12:08 pm

Excellent thanks for that Martin,

I could wrap this up into a component if that would be useful. This way you could set the number of 7-seg digits and simulate.
These users thanked the author Benj for the post (total 2):
medelec35 (Tue Jan 28, 2020 12:12 pm) • jgu1 (Tue Jan 28, 2020 7:19 pm)
Rating: 10%
 

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

Re: Shift Register 74HC595

Postby medelec35 » Tue Jan 28, 2020 12:14 pm

Thanks Ben.
Benj wrote:I could wrap this up into a component if that would be useful. This way you could set the number of 7-seg digits and simulate.

That does sound like a good idea.
You can never have too many components.
These users thanked the author medelec35 for the post (total 2):
Benj (Tue Jan 28, 2020 2:20 pm) • jgu1 (Tue Jan 28, 2020 7:19 pm)
Rating: 10%
 
Martin

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

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

Re: Shift Register 74HC595

Postby Benj » Tue Jan 28, 2020 6:21 pm

OK I've added the component to the update system now. If anyone has a go with it then let me know how you get on.
These users thanked the author Benj for the post (total 2):
medelec35 (Tue Jan 28, 2020 7:00 pm) • jgu1 (Tue Jan 28, 2020 7:19 pm)
Rating: 10%
 

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

Re: Shift Register 74HC595

Postby jgu1 » Tue Jan 28, 2020 10:30 pm

Hi Ben!

I have a couble 4x7 segment driven by the 595 and I make
A test tomorrow evening. You hear very good idea
With such :D a component too

Br Jorgen
These users thanked the author jgu1 for the post:
Benj (Wed Jan 29, 2020 11:06 am)
Rating: 5%
 

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

Re: Shift Register 74HC595

Postby Derrihj » Wed Jan 29, 2020 10:26 pm

[quote="Attached is the file converted to V7/V8.[/quote]

Hi Martin according to your flowchat, for me to understand this easily suppose i have arranged my output like in the image below and i want to display a 5 on digit 1 (D1), then a 7 on digit 2 (D2) and a 8 on digit 3 (D3) how will the flowchat be like for an output arrangement like below?
Attachments
74HC595 Image.jpg
74HC595 Image.jpg (102.27 KiB) Viewed 956 times

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

Re: Shift Register 74HC595

Postby Derrihj » Thu Jan 30, 2020 7:01 am

Ok this is how i understand your program Martin correct me if am wrong. You are shifting bits one at a time into the shift register in response to a clock pulse of 1ms and after you have pushed all the 8 bits into the shift register, you jump out of the loop and you latch all the content of the shift register into the storage register which also appears on the output in parallel right? , My problem is the "theory is all over my head ringing bells all the time" Yet the practical bit of it is not yet there.Ok lets do some practical for me to get this into my little head so fast.Please help me take the flowchat below and add the 595 but with an output setting as the picture i provided above its a prog reading voltage from 0 - 55v with that example i believe i will get this in my head in a blink of an eye thanks to all of you guys, learning new things is intresting.
Attachments
3Digit 7seg 0-55v voltmeter - Update.fcfx
(15.82 KiB) Downloaded 27 times
Last edited by Derrihj on Fri Jan 31, 2020 9:27 am, edited 1 time in total.

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

Re: Shift Register 74HC595

Postby medelec35 » Thu Jan 30, 2020 3:29 pm

Hi Derrihj,
The flowchart I posted was only intended as educational rather than used within a practical application.
For Practical applications try Ben's new 7Seg(74HC595) component.
On hardware should be just what you are after.
If you would like any help with that or how the flowchart I posted drives 74HC595 then let me know.
These users thanked the author medelec35 for the post:
jgu1 (Thu Jan 30, 2020 4:04 pm)
Rating: 5%
 
Martin

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

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

Re: Shift Register 74HC595

Postby jgu1 » Thu Jan 30, 2020 4:08 pm

Hi Martin and Derijj!

I am agree with Martin. I already test Ben’s new component. It work, almost :wink:

Look at this message.

Nr Jorgen.
These users thanked the author jgu1 for the post (total 2):
medelec35 (Thu Jan 30, 2020 6:36 pm) • Benj (Fri Jan 31, 2020 2:12 pm)
Rating: 10%
 

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

Re: Shift Register 74HC595

Postby medelec35 » Thu Jan 30, 2020 6:45 pm

Hi Jorgen,
jgu1 wrote: I already test Ben’s new component. It work, almost

I have moved your bugs report to the bugs section, so all the bugs are in the same section of V8.
I have also edited your post to show the new link.
These users thanked the author medelec35 for the post (total 2):
jgu1 (Thu Jan 30, 2020 7:43 pm) • Benj (Fri Jan 31, 2020 2:12 pm)
Rating: 10%
 
Martin

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

jgu1
Posts: 1179
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1104 times
Been thanked: 295 times
Contact:

Re: Shift Register 74HC595

Postby jgu1 » Fri Jan 31, 2020 6:51 am

Hi Martin!

Well,ok. As I wrote, I don`t know if it i a bug or me who do something wrong, I only discover some weird thing, I saw that Ben would create a component to Derrij and I have one display I could test with and I only want to be kind and help in this tread and not trouble.

Apologize for the inconvenience.

Jorgen

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

Re: Shift Register 74HC595

Postby medelec35 » Fri Jan 31, 2020 6:59 am

Hi Jorgen,
Apologies are not required at all.
You have done nothing wrong.
It's the opposite, so it's greatly appreciated.
Any bug reports whether right or wrong really helps a lot.
I just thought all bugs are better in the bugs section,
so would leave this topic for talking about how to use 74HC595.
It also helps to stop bug reports getting missed when in normal threads.
These users thanked the author medelec35 for the post:
jgu1 (Fri Jan 31, 2020 12:52 pm)
Rating: 5%
 
Martin

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

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

Re: Shift Register 74HC595

Postby Benj » Fri Jan 31, 2020 2:15 pm

Hello Derrihj,

Hi Martin according to your flowchat, for me to understand this easily suppose i have arranged my output like in the image below and i want to display a 5 on digit 1 (D1), then a 7 on digit 2 (D2) and a 8 on digit 3 (D3) how will the flowchat be like for an output arrangement like below?


At the moment the new component assumes that you have wired in a certain way.

Q0 - A
Q1 - B
Q2 - C
Q3 - D
Q4 - E
Q5 - F
Q6 - G
Q7 - DP

However one of the problems mentioned by Jorgen seems to suggest this might not work for his hardware and so I might have to add a way of remapping the segments on the shift register. I take it you wired in the way you did to make the wiring easier, say on a single layer PCB?

If you're using Martins example instead of the component then you can simply re-order the segment bit patterns as required.
These users thanked the author Benj for the post:
Derrihj (Fri Jan 31, 2020 10:46 pm)
Rating: 5%