How to get to work 2 loops at the same time?

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

Moderators: Benj, Mods

Post Reply
alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

How to get to work 2 loops at the same time?

Post by alexander70 »

Hello! For example, in my algorithm (attached) must operate 2 loops at the same time, the first loop is used for display at the 4-digit 7-segment LED, and the second loop - primary, perform pulse counting of the button. How to make the work simultaneously 2 (or more) loops?
Attachments
Flowcode3swithes7seg-1.fcf
(7 KiB) Downloaded 365 times
Respectfully, Alexander

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

Re: How to get to work 2 loops at the same time?

Post by Benj »

Hello Alexander

Timer interrupts are a good start, there should be a workable example in the examples section for V3.

Alternativley make one master loop and use a counter and a decision to decide which part of the loop to process.

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Thank you, I will study these examples.
Respectfully, Alexander

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

Re: How to get to work 2 loops at the same time?

Post by Benj »

Hello Alex

The 7 seg examples should help a lot. If your using version 3 then the standard examples can be found in your Flowcode v3/Examples folder.

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Hi! In the example TUT20 (attached) indicates that there 4 macro:
INTERRUPT_PORTB
INTERRUPT_RB0INT
INTERRUPT_TMR0
UPDATE_VALUES

The algorithm is called macros UPDATE_VALUES, but this macro is not visible. There is only a macros INTERRUPT_TMR0. Where are the other macros?

And I want to ask about the example TUT19. How it should work? When I started simulation, there is lit digit 0.
Attachments
TUT_20.FCF
(9 KiB) Downloaded 325 times
TUT_19.FCF
(5.5 KiB) Downloaded 325 times
Respectfully, Alexander

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

Re: How to get to work 2 loops at the same time?

Post by Benj »

Hello

if you click on the macro menu and then show then you will get a list of the macros already included in the program.

TUT19 uses a timer interrupt, this does not simulate overly well but will run great on the hardware. Here is an article explaining the timer function a bit clearer.

http://www.matrixmultimedia.com/mmforum ... =26&t=6390

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

What does mean call macros UPDATE_VALUES in the flowchart (TUT20)? In meny Window there is no such macros.
TUT20.jpg
TUT20.jpg (12.62 KiB) Viewed 8914 times
Respectfully, Alexander

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

Re: How to get to work 2 loops at the same time?

Post by Benj »

Hello Alexander

Click on the Macro Menu and select Show.

In the window that pops up select the UPDATE_VALUES item and click show.

Alternatively you can select the macro icon in the flowchart, double click it to reveal its properties and then click ok and edit to open up the macro window.

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Thank you, now this is clear.
Respectfully, Alexander

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Hi! I have a question about Example 21 "Printing a message to an LCD". If I have russified indicator, How to print to LCD non Latin characters (Cyrillic)?
Respectfully, Alexander

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

Re: How to get to work 2 loops at the same time?

Post by Benj »

Hello Alexander

Please see this article for instructions on creating your own LCD characters.

http://www.matrixmultimedia.com/mmforum ... =26&t=4796

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Hi! I want to ask about the example TUT21. In the real indicator PC1602 present PINS R/W, DB4, DB5, DB6, DB7 ( http://www.winstar.com.tw/products_deta ... u&ProID=26 ) , which in the example are not connected. What level should apply for these PINS?
Respectfully, Alexander

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

Re: How to get to work 2 loops at the same time?

Post by Benj »

Hello

The LCD is connected by connecting the Data lines to the high nbble of the LCD. Eg so D0 connects to Data 4 on the LCD etc.

The R/W pin on the LCD is connected to ground and the D0 - D3 pins are simply not connected.

For a bullet proof wiring guide please refer to our EB005 datasheet which includes a full board schematic.

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Thank you, give please an exact link to EB005 datasheet
Respectfully, Alexander

alexander70
Posts: 79
Joined: Mon Aug 03, 2009 12:14 pm

Re: How to get to work 2 loops at the same time?

Post by alexander70 »

Respectfully, Alexander

Post Reply