Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FlowCode 8 with ATTiny45, Timer

Status
Not open for further replies.

ernestocat

Newbie level 5
Newbie level 5
Joined
Aug 12, 2021
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
65
Measured: The programmed "Delay"-Time in FlowCode 8 is eg. 1000 ms. The real measured Delay-Time is about 7 seconds.
My Question: What have I to do, that the measured time is equal the “Delay-time setting”?
 

Attachments

  • FC8_Tiny45_Settings.pdf
    40.4 KB · Views: 218

Hi
Thank you. Please see the Attachment.

Ernesto
 

Attachments

  • FC8_Tiny45_Timer_C01.pdf
    134.4 KB · Views: 231

Hi,

Never seen such coding style. A lot of libraries are included, but I can't see how they are used.
Is this hand written code or generated code?

Are there possibly other interrupts running?


Klaus
 

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Seems to be running approximately 8 times too slow so it's a clock speed or clock divider problem I would guess.

The code style suggests it is automatically generated by converting each node in the flow diagram into a generic function then using 'ifdef' to customize it. The resulting code may work but almost certainly isn't optimized and is impossible to read without a copy of the flow chart to hand.

I'm generally against this kind of program development, it carries too much baggage into the final executable. Flow charting on paper is fine but it should be hand coded, using libraries where appropriate, in the program.

Brian.
 

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Hi Klaus

As you suspect, it's generated code by FC8.
I don't know why there are so many libraries included!?
Whether one of the libraries is the reason for the timer error? I have no idea.
One way to find out this, could be to load a (hand written) short On/Off sequence onto the Tiny45 via arduino uno.
Actually not my goal, but i want to try it.

By the way: my previous inquiry to MATRIX did not bring any results.

Any way. Perhaps I can contact you again with results of the arduino session.

Many Thanks and
best regards
Ernesto
 

Hi,

do you have some programmer to directly access the ATTINY to verify fuse settings.
Maybe it´s running on internal (about) 1MHz instead of external 8MHz.

Instead of posting code in a PDF you may upload it as .txt file or inline using the CODE button.

Klaus
 

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Flowcode is one of many graphical programming languages being used
in schools and now by hobbyists and beginning in engineering. Like
Covid vax shots graphical programming is as controversial as C was when
first introduced. A number of universities now active in this area, such as
MIT and Stanford to name a few. Like IDEs that we use with front end chip
setup code, todays embedded work rely on a bedrock of libraries that we
do not write nor care to. In my career I met engineers who would NOT use
libraries to develop projects. Fortunately they were in the minority.


The ultimate goal is to use telepathy to an AI system and think a requirement
and the AI system creates it, down to the CNC machining, 3D printing,
creation of products and systems. But I diverge.

Flowcode, Snap4Arduino, for example integrate simple methods, like to use
Windows libraries for speech, to connect the embedded world to the OS
world, without having to really care how every bit and byte is manipulated
to speak an embedded variable value. Also Bluetooth, considered fairly
involved complex protocol, is made significantly easier to create. US schools,
grade school, using a number of block languages to program robots.

In Flowcode 2020 there is a setup screen where one chooses target to config clock -

1628935807837.png


See lower right, "other options", for setting ATTINY clock. Maybe this is problem .....


Regards, Dana.
 
Last edited:

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Hi

As mentioned I have carried out the Test with Tiny45 via arduino one SMD (please see Attachment)

The results -> as expected.

Question to Klaus: Where can I find the CODE Button ?
Which type of programmer for directly access whould you suggest ?

Question to Dana: How can I find to your FlowCode Startscreen ? (I actually work with flowcode 8)

Thanks and
best regards
Ernesto
 

Attachments

  • AR_Tiny45_DTest_20210815.pdf
    253.3 KB · Views: 162
  • FlowCode_NewPrj_20210815.pdf
    45.3 KB · Views: 203

Hi,

CODE button --> [ </> ] in the top command bar where you set [BOLD], [ITALIC], [UNDERLINE]
Maybe you need to press the button with the [three vertical dots] first.
Just do some tests with the editor functions. Nothing special. Mostly self explaining.

Klaus
--- Updated ---

Did you notice your mistake?

In post#1 you tell flowcode to calculate with 8MHz clock frequency.
But in the ATtiny45 setup of post#9 you select 1MHz internal clock.
This does not match and explains the wrong timing.

--> Either set both to 1MHz or both to 8MHz.

Klaus
 
Last edited:

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Hi

As mentioned I have carried out the Test with Tiny45 via arduino one SMD (please see Attachment)

The results -> as expected.

Question to Klaus: Where can I find the CODE Button ?
Which type of programmer for directly access whould you suggest ?

Question to Dana: How can I find to your FlowCode Startscreen ? (I actually work with flowcode 8)

Thanks and
best regards
Ernesto
That screen shows when you select "New Project" to start new design.

Version 9.2.0


Regards, Dana.
 

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Flowcode is one of many graphical programming languages being used
in schools and now by hobbyists and beginning in engineering. Like
Covid vax shots graphical programming is as controversial as C was when
first introduced. A number of universities now active in this area, such as
MIT and Stanford to name a few. Like IDEs that we use with front end chip
setup code, todays embedded work rely on a bedrock of libraries that we
do not write nor care to. In my career I met engineers who would NOT use
libraries to develop projects. Fortunately they were in the minority.


The ultimate goal is to use telepathy to an AI system and think a requirement
and the AI system creates it, down to the CNC machining, 3D printing,
creation of products and systems. But I diverge.

Flowcode, Snap4Arduino, for example integrate simple methods, like to use
Windows libraries for speech, to connect the embedded world to the OS
world, without having to really care how every bit and byte is manipulated
to speak an embedded variable value. Also Bluetooth, considered fairly
involved complex protocol, is made significantly easier to create. US schools,
grade school, using a number of block languages to program robots.

In Flowcode 2020 there is a setup screen where one chooses target to config clock -

View attachment 171326

See lower right, "other options", for setting ATTINY clock. Maybe this is problem .....


Regards, Dana.
Hi

Question: How can I find to your FlowCode Startscreen ? (I actually work with flowcode 8)

Thanks and
best regards
Ernesto
 

Hi,

CODE button --> [ </> ] in the top command bar where you set [BOLD], [ITALIC], [UNDERLINE]
Maybe you need to press the button with the [three vertical dots] first.
Just do some tests with the editor functions. Nothing special. Mostly self explaining.

Klaus
--- Updated ---

Did you notice your mistake?

In post#1 you tell flowcode to calculate with 8MHz clock frequency.
But in the ATtiny45 setup of post#9 you select 1MHz internal clock.
This does not match and explains the wrong timing.

--> Either set both to 1MHz or both to 8MHz.

Klaus
Hi

I could not find any mistake.

Please note: Setting
"AR_Tiny45_DTest_20210816" -> Arduino -> Tiny45

is different to

Flowcode 8 -> programmer -> Tiny45

Practice:
To test both

"Arduino 8 MHz"
and
"Arduino 1 MHz"

I have carried out both settings.
Please see results in Attachment.

Best regards
Ernesto
 

Attachments

  • AR_Tiny45_DTest_20210816.pdf
    268.4 KB · Views: 131

That screen shows when you select "New Project" to start new design.

Version 9.2.0


Regards, Dana.
Hi

Nice to see.
Unfortunately, this is not available in version FC8 :-(

Unfortunately, the price for each new FC version is very high.
Matrix FC upgrades are too expensive. (my mind)

Many thanks to you
Ernesto
 

Hi

Nice to see.
Unfortunately, this is not available in version FC8 :-(

Unfortunately, the price for each new FC version is very high.
Matrix FC upgrades are too expensive. (my mind)

Many thanks to you
Ernesto
I am using free version, so do not face those challenges.

You could always just program the fuses after you upload the code,
to at least get it working with correct clock. Just a thought.



Keep in mind you can brick parts programming the wrong fuse setting. So
do the research on the setting you want to change first to make sure you
don't hose your chip.


Regards, Dana.
 
Last edited:

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
Hi,

In post#10 I wrote: "--> Either set both to 1MHz or both to 8MHz."
Now in your document of post#13 I see you set both set to 8MHz it works.
So far so good.

To me it's confusing that you play around with multiple setups .. some work, some not.
Setting FC8 to 8MHz and arduino to 1MHz does not work, quite expectable.

So: please give short (no PDF with pages full of screenshots) answer:
What setup (FC8 and arduino) do you want, and how does it behave?

Mind: Possibly the delay function has a maximum ms limit.
I don't know where this limit is. If your desired setup does not work like expected then try
* to use a loop that runs n times "delay of 1 second".

Klaus
 

    ernestocat

    Points: 2
    Helpful Answer Positive Rating
AVRDUDE for burning boot, code, and fuses -



Regards, Dana.
Hi
Thanks for info!
I will now study the documentation.

Yet,
as you know, when I load the Tiny45 using the arduino uno as programmer, the FC8 delay works correct.

Annotation:
That I can use the arduino uno as programmer for Tiny45, I have been to load a special Arduino program to arduino before.

My next step
is now, to analyse this arduino-(pre)program to find out, which fuses/values will be loaded to Tiny45 by arduino.

I report to you

Best regards
Ernesto
 

Hi
heureka !
Now It has finished with a happy end .... it works !!

The solution lies in the fuse settings.
Please see the Attachment.

Many thanks for your helpful advices.
have a good time and best regards

Ernesto
 

Attachments

  • AVR_CKDIV_Setting_20210818.pdf
    90.6 KB · Views: 161

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top