Codeless State Machine

Thread Starter

danadak

Joined Mar 10, 2018
4,057
Here is a short video on creating a codeless state machine. Traffic Light example.


No user code was written, tool does generate code however, and you program part.
But again user did not write any code. Lots of capability in tool to do various codeless
design, or at most a single of code to start the more sophisticated modules internal
like A/D, PWM, DAC, OpAmp.....


Regards, Dana.
 

joeyd999

Joined Jun 6, 2011
6,279
Here is a short video on creating a codeless state machine. Traffic Light example.


No user code was written, tool does generate code however, and you program part.
But again user did not write any code. Lots of capability in tool to do various codeless
design, or at most a single of code to start the more sophisticated modules internal
like A/D, PWM, DAC, OpAmp.....


Regards, Dana.
Kids are so damn spoiled these days.

They'll never learn the concept of -- or satisfaction in -- hard work.

...up hill, both ways...
 

Wolframore

Joined Jan 21, 2019
2,619
Ugh that’s stoopid it’s microsoft and bloat all over again. It will only bring more people here with the wrong MOSFETs wired backwards and floating saying make it work and send me a diagram.
 

MisterBill2

Joined Jan 23, 2018
27,508
I have created a state machine to convert a 360 pulse per revolution encoder string to a 100 pulse per revolution signal for a balancing machine. All it had to do was deliver a pulse every every 3.6 pulses input. And of course it had to work going forward and backward. It was sort of simple until you consider it was all done with 4000 series CMOS back in 1978.
 

Thread Starter

danadak

Joined Mar 10, 2018
4,057
Having come from the era of punched paper tape and monitors with
resolution of brick sized pixels I love moving forward with better tools.

Looking forward to when I can telepathically talk to a machine and it goes
off and does all the light lifting and writes the code and builds the proto.

Human race has better things to do, like escape the planet before it goes
red giant. Thats going to take a lot of heavy thinking.

Regards, Dana.
 

joeyd999

Joined Jun 6, 2011
6,279
Having come from the era of punched paper tape and monitors with
resolution of brick sized pixels I love moving forward with better tools.

Looking forward to when I can telepathically talk to a machine and it goes
off and does all the light lifting and writes the code and builds the proto.

Human race has better things to do, like escape the planet before it goes
red giant. Thats going to take a lot of heavy thinking.

Regards, Dana.
You realize where this ends, don't you?

Humans drawing a pictogram of a buffalo on a cave wall causing a plate of chicken wings to magically appear -- with no idea of how or why.
 

Wolframore

Joined Jan 21, 2019
2,619
Having come from the era of punched paper tape and monitors with
resolution of brick sized pixels I love moving forward with better tools.

Looking forward to when I can telepathically talk to a machine and it goes
off and does all the light lifting and writes the code and builds the proto.

Human race has better things to do, like escape the planet before it goes
red giant. Thats going to take a lot of heavy thinking.

Regards, Dana.
The issue I have with this is not about having better tools... it's about poor programming... Having spent a fair amount of time with some of these chips every time something gets between you and programming it seems like there's garbage being added... many times it's for safety because they can't know your possible intent, other times it repeats instructions because it does not know how the chip is set up... in any case an example: Arduino IDE version of looping a simple high and low output. It is easy to use but here are the results:

digitalwrite() for 16Mhz Arduino takes 3.3-3.5 uSec equating to about 148kHz This is pretty fast

using direct port manipulation for the same 16Mhz Arduino takes 125nS (2 clocks high) - 251nS (4 clocks low) equating to about 2.7Mhz.

Graphical interfaces are great but what I don't like is that we keep increasing the speed of the controller to get what we want instead of maximizing through good programming the capabilities of what you have. These little chips are pretty low level compared to what you can get and also incredible for what they are.

This also reminds me of Macromedia dreamweaver... it was great because you didn't have to learn html and allowed folks to make pages visually. But wow the lines of repeated commands... I'm sure it slowed down performance.
 

joeyd999

Joined Jun 6, 2011
6,279
The issue I have with this is not about having better tools... it's about poor programming... Having spent a fair amount of time with some of these chips every time something gets between you and programming it seems like there's garbage being added... many times it's for safety because they can't know your possible intent, other times it repeats instructions because it does not know how the chip is set up... in any case an example: Arduino IDE version of looping a simple high and low output. It is easy to use but here are the results:

digitalwrite() for 16Mhz Arduino takes 3.3-3.5 uSec equating to about 148kHz This is pretty fast

using direct port manipulation for the same 16Mhz Arduino takes 125nS (2 clocks high) - 251nS (4 clocks low) equating to about 2.7Mhz.

Graphical interfaces are great but what I don't like is that we keep increasing the speed of the controller to get what we want instead of maximizing through good programming the capabilities of what you have. These little chips are pretty low level compared to what you can get and also incredible for what they are.

This also reminds me of Macromedia dreamweaver... it was great because you didn't have to learn html and allowed folks to make pages visually. But wow the lines of repeated commands... I'm sure it slowed down performance.
It's worse than that.

When I write my own libraries, I only have to trust myself.

When I use someone else's (whether graphically realized or otherwise), I have to trust them. And I don't know them -- or their skills.

I also have to trust that future library updates and bug fixes don't brick my code.
 

Thread Starter

danadak

Joined Mar 10, 2018
4,057
Humans drawing a pictogram of a buffalo on a cave wall causing a plate of chicken wings to magically appear -- with no idea of how or why.
Joeyd999. the end is the end, empty space time full of virtual particles going nowhere in particular. I find comfort in that.

Based on the performance of the human race I am all in to being virtual, and non existent.

I am in fact trusting, more of thousands of programmers using a library, and effectively debugging it,
than what I write, and debug barely, in comparison.

I once worked on a Teradyne IC tester, all machine language, and I had to write test vectors for
the CPU because Teradyne had no doc/manual for it it was so new. I learned far more about that
machine than was or should have been necessary. And I have a limited brain pan, hence memory
is precious. That experience took up way too much of my amoeba sized memory.


Regards, Dana.
 

joeyd999

Joined Jun 6, 2011
6,279
Joeyd999. the end is the end, empty space time full of virtual particles going nowhere in particular. I find comfort in that.

Based on the performance of the human race I am all in to being virtual, and non existent.

I am in fact trusting, more of thousands of programmers using a library, and effectively debugging it,
than what I write, and debug barely, in comparison.

I once worked on a Teradyne IC tester, all machine language, and I had to write test vectors for
the CPU because Teradyne had no doc/manual for it it was so new. I learned far more about that
machine than was or should have been necessary. And I have a limited brain pan, hence memory
is precious. That experience took up way too much of my amoeba sized memory.


Regards, Dana.
The problem is, when your replicator goes on the fritz, and no quantity or style of buffalo pictograms on the cave wall produces you a plate of chicken wings, you go hungry.

And when the last replicator repairman dies, so goes the rest of us.
 

Thread Starter

danadak

Joined Mar 10, 2018
4,057
digitalwrite() for 16Mhz Arduino takes 3.3-3.5 uSec equating to about 148kHz This is pretty fast

using direct port manipulation for the same 16Mhz Arduino takes 125nS (2 clocks high) - 251nS (4 clocks low) equating to about 2.7Mhz.
Totally agree, several ap notes in specific vendors lineup covering that exact subject.

I found C typing, as strong as everyone would like us to believe, is very subject to specific compiler
processing. I am not the best or worst programmer, but have had more than one experience writing
variations of code to get more program space. Results can be eye opening. And I don't think I
type code poorly.

What I like about the visual stuff is not its depth, but rapidity I can crank out simple stuff. I use
it mostly as test bed generators, and simple controls. And the flow chart like version fit my visual
brain really well. But when I am doing "real" stuff its back to C and occasionally inline ASM. I wrote
a lot of ASM in 70's and good part of 80's, don't want to go back.

Regards, Dana.
 

Thread Starter

danadak

Joined Mar 10, 2018
4,057
The problem is, when your replicator goes on the fritz, and no quantity or style of buffalo pictograms on the cave wall produces you a plate of chicken wings, you go hungry.

And when the last replicator repairman dies, so goes the rest of us.
Joey, thats a good outcome as far as I am concerned.


Regards, Dana.
 

Wolframore

Joined Jan 21, 2019
2,619
And the flow chart like version fit my visual brain really well.
This i can understand... I have to create visual flows in my head when I work on this stuff... in fact I've been discussing this topic with a friend... there are some that says you cannot think without words... I disagree. I'm a visual thinking as well.

in any case, dreamweaver was awesome and clumsy at the same time... not sure if it's still around.
 

ElectricSpidey

Joined Dec 2, 2017
3,334
@danadak, Yo, I’m intrigued, and have been thinking about trying to do some of my projects using these chips.

A couple of questions…

1. Can I create a state machine with 16 outputs that turn on one at a time in sequence, but can also be reversed in direction at any time?

2. Is it possible to control the direction change with a clock from an input with a pot? (change the pot and the direction changes sooner or later)

3. Can the speed of the transitions be controlled from an input pin as well? (control a clock from an external device…pot)

Thanks
 

Thread Starter

danadak

Joined Mar 10, 2018
4,057
Yes to all, depending on speed you want from one output to the next.

Speed by pot, yes, use onboard SAR to control a PWM to use as a clock.

I visualize this not as a state machine but just simple sequential logic driving
a DMUX. And SAR to control clock.


Regards, Dana.
 

ElectricSpidey

Joined Dec 2, 2017
3,334
I see...and this is done without coding?

The speed of the increments will be below 10 Hz, and the direction change even slower, maybe every 5 -10 seconds.
 
Last edited:

Thread Starter

danadak

Joined Mar 10, 2018
4,057
Code would be required because of primarily the pot controls over
direction and speed. Eg, you are transitioning an analog to digital,
code needed to do this.

Estimate < ~ 25 lines of code.

I did a fast approach, might be possible to do a little more HW control
w/o user intervention, but code still needed for control issue.

Have you done any coding at all ?


Regards, Dana.
 

ElectricSpidey

Joined Dec 2, 2017
3,334
And just to be sure…this is not a binary counter…right?

No coding, just a little HTML.

Possible to eliminate coding if I use an external clock connected to an input pin?

It’s no coding or nothing.
 

Thread Starter

danadak

Joined Mar 10, 2018
4,057
The counter is a binary up/dwn counter. That drives the demux address
selection.

An external clock and external up/dwn could dramatically decrease
coding. I would have to look at that further.

I think if I used the LUT and one pin clocks the LUT and one pin causes
it to up / dwn count it could be done code free.

The state machine wizard could be used, to generate the demux address,
would need further investigation. That would be code free as well.


Regards, Dana.
 
Last edited:
Top