Hello,
I am getting acquainted with Flowcode9.2
I have written a simple program for AT Tiny45.
The function works fine in the debug simulation.
I then created a HEX file and loaded it in the processor.
Unfortunately it does not work there.
The hardware works fine with the same program (not flowcode).
I assume that it is because of the port definition. But in the debug everything is ok.
Function:
A/D converter 0-2V with delay, selection of 3 thresholds, output to 3 pin.
Where can I set the port properties of the processor?
Is it only possible via simulation?
Where can I read how big the compiled program is? (Flash, Ram, EEprom)
Thank you
simple programme for AT Tiny45 dont works
-
- Posts: 8
- http://meble-kuchenne.info.pl
- Joined: Sat Sep 11, 2021 7:18 pm
simple programme for AT Tiny45 dont works
- Attachments
-
- LKL1000_1-0-08.fcfx
- (25.12 KiB) Downloaded 608 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 686 times
Re: simple programme for AT Tiny45 dont works
Hello,
There are two potential issues I've noticed in your program,
The first is this icon.
It is calling a simulation only function and therefore the code will not be called on download. If you want to set the ADC configuration then it's better to do it via the ADC component properties.
The other thing I can see is the AND in your calculation icons in the SchwellePrufen macro. The AND keyword is a binary bitwise AND and you probably want a comparison type AND in which case you must use the syntax &&.
e.g.
U_summe < MIN_GRENZE_0 AND Schwelle0 = 1
becomes
U_summe < MIN_GRENZE_0 && Schwelle0 = 1
If this still isn't working as intended then let us know and we can investigate further.
There are two potential issues I've noticed in your program,
The first is this icon.
It is calling a simulation only function and therefore the code will not be called on download. If you want to set the ADC configuration then it's better to do it via the ADC component properties.
The other thing I can see is the AND in your calculation icons in the SchwellePrufen macro. The AND keyword is a binary bitwise AND and you probably want a comparison type AND in which case you must use the syntax &&.
e.g.
U_summe < MIN_GRENZE_0 AND Schwelle0 = 1
becomes
U_summe < MIN_GRENZE_0 && Schwelle0 = 1
If this still isn't working as intended then let us know and we can investigate further.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 1001
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: simple programme for AT Tiny45 dont works
Hoi Rapid
Is your program working in the AT?
If you change the led_clip to TurnOn and put a delay about 2second before the while loop, are the Led lights on?
regards
Stefan
config the AT
Is your program working in the AT?
If you change the led_clip to TurnOn and put a delay about 2second before the while loop, are the Led lights on?
regards
Stefan
config the AT
Re: simple programme for AT Tiny45 dont works
II have tried the changes, but it runs as before, in debug mode everything ok, in hardware not.
I noticed that one LED_chalieplexed device gohst that is no longer present on my panel. This I also can not delete because he is not there.
The properties LED_chalieplexed are present.
In picture 3 you can see that PortB is controlled correctly in the simulation.
I noticed that one LED_chalieplexed device gohst that is no longer present on my panel. This I also can not delete because he is not there.
The properties LED_chalieplexed are present.
In picture 3 you can see that PortB is controlled correctly in the simulation.
- Attachments
-
- LED_charlieplexed ghost
- Panel1.JPG (85.29 KiB) Viewed 6984 times
-
- Panel2.JPG (20.32 KiB) Viewed 6984 times
-
- Panel3.JPG (80.76 KiB) Viewed 6984 times
Re: simple programme for AT Tiny45 dont works
Hi Stefan,
yes the LED goes On/Off
The Pocessor configuration seems ok.
I'm trying with an other output method but without success.
(simulation on the panel is still ok)
yes the LED goes On/Off
The Pocessor configuration seems ok.
I'm trying with an other output method but without success.
(simulation on the panel is still ok)
- Attachments
-
- decision new.JPG (28.83 KiB) Viewed 6981 times
Re: simple programme for AT Tiny45 dont works
new attempt...
i send a pulse at the end of the main loop from 1s on Channel 2.
But in the reality is 8sec on ???
i send a pulse at the end of the main loop from 1s on Channel 2.
But in the reality is 8sec on ???
- Attachments
-
- pulse 1s are 8s.JPG (53.64 KiB) Viewed 6979 times
-
- Valued Contributor
- Posts: 1001
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: simple programme for AT Tiny45 dont works
Hoi Rapid
You can choose Set clock speed to 1Mhz or set the clock divider to 1
regards
Stefan
You can choose Set clock speed to 1Mhz or set the clock divider to 1
regards
Stefan
Re: simple programme for AT Tiny45 dont works
Ok Stefan is clear!
now the time works correctly. i must set the fuse with my programmer.
I think the reading of the analog input is not working in the reality properly.
the Output seems to work.
now the time works correctly. i must set the fuse with my programmer.
I think the reading of the analog input is not working in the reality properly.
the Output seems to work.
Re: simple programme for AT Tiny45 dont works
hello Matrix,
I have now solved my problem, but it was not easy because there are a few misunderstandings in Flocode (9.2). Of course from the point of view of a flowcode beginner.
My program could be simulated correctly but it didn't run properly in the processor because the A/D channel2 wasn't read correctly due to the missing initialization of the component "pot_panel1" ???? what's going on????
# 1 In no example I found was a component initialised, and yet you can simulate everything beautifully.
# 2 why is there no command "initialisation of ports"?
Why isn't there an analog input command?
# 3 What does a "potentiometer simulation" have to do with the port?
these are two different things, aren't they?
Obviously the simulation is part of the definition of the processor.
You don't notice that as long as it's just about creating pretty pictures on the screen, but in the real world it doesn't work like that.
# 4 Is it possible to write a program without components?
# 5 The properties of "pot_panel1" in the panel are different and incomplete compared to those in components (see pictures). Why different names? What is valid now?
Hello Matrix, you have made a very nice program from the point of view of a PC software man,...... but I want to have the function in the processor.
Translated with www.DeepL.com/Translator (free version)

I have now solved my problem, but it was not easy because there are a few misunderstandings in Flocode (9.2). Of course from the point of view of a flowcode beginner.
My program could be simulated correctly but it didn't run properly in the processor because the A/D channel2 wasn't read correctly due to the missing initialization of the component "pot_panel1" ???? what's going on????
# 1 In no example I found was a component initialised, and yet you can simulate everything beautifully.
# 2 why is there no command "initialisation of ports"?
Why isn't there an analog input command?
# 3 What does a "potentiometer simulation" have to do with the port?
these are two different things, aren't they?
Obviously the simulation is part of the definition of the processor.
You don't notice that as long as it's just about creating pretty pictures on the screen, but in the real world it doesn't work like that.
# 4 Is it possible to write a program without components?
# 5 The properties of "pot_panel1" in the panel are different and incomplete compared to those in components (see pictures). Why different names? What is valid now?
Hello Matrix, you have made a very nice program from the point of view of a PC software man,...... but I want to have the function in the processor.

Translated with www.DeepL.com/Translator (free version)
- Attachments
-
- Pictures.zip
- (122.53 KiB) Downloaded 459 times
-
- LKL1000_1-0-12.fcfx
- (19.7 KiB) Downloaded 618 times
-
- Matrix Staff
- Posts: 1916
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 621 times
- Been thanked: 644 times
Re: simple programme for AT Tiny45 dont works
Hi, rapid.
I Don't use the set properties macro when setting up ADC.
What I do is add on to the panel the required pots.
So if I want to read from An0, An1 and An2 I add three posts to the panel.
It does not matter which type of pot as they all will work the same.
Next, I would select the properties of each pot in turn.
You can select the properties from either right-click on the pot that's on the 2D (or 3D ) panel and select properties, or select View ribbon and select properties.
If the latter then you will need to select the Pot from the drop-down arrow: Set the required properties e.g the port pin within the Channel (An2), VREF option etc.: The Vref voltage is for simulation only, but the VREF option, Conversion speed and Acquistion cycles are all hardware settings, so it's important for them to be correct.
Personally, I find the higher / values for conversion speed work better.
When you want to read your ADC pin, then use either of the Read options e.g: If you have added two pots then for pot2 you will do the same but instead of selecting macros from pot_panel1 there will also be a pot_panel2 to select macros from.
Hope this helps?
I Don't use the set properties macro when setting up ADC.
What I do is add on to the panel the required pots.
So if I want to read from An0, An1 and An2 I add three posts to the panel.
It does not matter which type of pot as they all will work the same.
Next, I would select the properties of each pot in turn.
You can select the properties from either right-click on the pot that's on the 2D (or 3D ) panel and select properties, or select View ribbon and select properties.
If the latter then you will need to select the Pot from the drop-down arrow: Set the required properties e.g the port pin within the Channel (An2), VREF option etc.: The Vref voltage is for simulation only, but the VREF option, Conversion speed and Acquistion cycles are all hardware settings, so it's important for them to be correct.
Personally, I find the higher / values for conversion speed work better.
When you want to read your ADC pin, then use either of the Read options e.g: If you have added two pots then for pot2 you will do the same but instead of selecting macros from pot_panel1 there will also be a pot_panel2 to select macros from.
Hope this helps?
Martin