Page 1 of 1

implementing finite state machines with PICs

Posted: Sun Aug 11, 2002 7:14 pm
by Isenbergdoug
Does anybody have any general tips or experience doing this, or ideas for directly going from a Moore or Mealy machine diagram or flowchart to a programming flowchart? <p>Douglas

Re: implementing finite state machines with PICs

Posted: Mon Aug 12, 2002 9:40 am
by hlreed
Why do you want a finite state machine?

Re: implementing finite state machines with PICs

Posted: Thu Aug 22, 2002 10:25 pm
by bobsRAC
I've done a fair amount of state machines in CPLDs. I use a state register and some combinational logic to determine the next state.<p>In a microcontroller solution, This may not be as efficient as using an if-else-if of switch architecture. Within the execution of each state, the next state is loaded into the state register.<p>Are you implementing it in assembly or C?

Re: implementing finite state machines with PICs

Posted: Mon Sep 02, 2002 6:23 pm
by Isenbergdoug
I've reasoned it out. For applications where asynchronous aspects are required at low frequencies, the PIC will work fine. However, at high frequencies, this aspect may be better implemented on a traditional FSM. Additionally, the flow chart created for the FSM can be almost exactly implemented into the PIC word for word, with each state being a label in assembly language, this is for a Moore machine and low speed Mealy machines. It's a real time saver!