Page 1 of 1

Save counter

Posted: Mon Nov 03, 2025 9:32 am
by lavomatique
Hi,

I'm French and new to Flowcode. I'm programming Flowcode 11 for an ATMEGA32L.

The program's goal is to run a motor for 9 products per line. When a line is empty, I switch to a different line.

My program uses a counter. I want this counter to be saved even if the power is cut.

I can't seem to save it to the EPROM. I'm not even sure I've configured it correctly.

The program and screenshots are in a Google folder: https://drive.google.com/drive/folders/ ... sp=sharing

Thank you for your help.

Anthony

Re: Save counter

Posted: Mon Nov 03, 2025 11:16 am
by medelec35
Hi Anthony.
One issue with your flowchart is you are using & for AND.
That is for bitwise compare instead of logical compare.
Bitwise is comparing bits and logical is for comparing variable values.
As a gude take a look at our Flowcode Wiki page on Mathematical Functions

You need to take into account that EEPROMS have a limited number of write cycles, before it gets worn out.

A way to get around saving the EPROM when there is a power cut see this post.
You find the who topic interesting

As you are new to flowcode you might find this very useful, especially the Examples and Tutorials section.