IEC state machine

From: Jim Brain (brain_at_jbrain.com)
Date: 2004-09-21 00:26:55

As Marko asked, I have created a graph of the IEC routines.  On Marko's
suggestion, I utilized GraphViz, though I need help in both taming the
graph and adding information to each state (When I wrote state diagrams, I
usually put the changes made during that state in the state bubble...)

This only shows IEC routines from peripheral point of view (slave mode, as
it were), and I still need to work on it (I need to add timeouts and
such).  But, it's short, sweet, and maybe someone else can help me in
this.  And, I need help, since all I know about GraphViz is from this
afternoon...

Here it is:

iec_states.dot

// Jim Brain (brain@jbrain.com) 2004-09-20 version 0.1
// TALK var is set to 1 when IEC TALK command is sent.
// LISTEN var is set to 1 when ATN device matches our device number

digraph iec_states {
  rankdir=LR;
  //orientation=land;
  center=1;
  ratio=auto;
  node [shape = doublecircle,width="2",height="2"]; IDLE CMD_IDLE;
  node [height=1.5, shape = circle, width="1.5", fixedsize=1];
  IDLE -> CHK_EOI	[ label = "LISTEN=1,CLK=1->0" ];
  CMD_IDLE -> CHK_EOI	[ label = "CLK=1->0" ];
  CMD_IDLE -> TALK_PREP [ label = "ATN=0->1,TALK=1" ];
  subgraph idle {
    IDLE -> CMD_IDLE	[ label = "ATN=1->0" ];
    CMD_IDLE -> IDLE	[ label = "TALK=0,ATN=0->1" ];
  }
  subgraph cluster_0 {
    rank=same;
    CHK_EOI -> EOI_TO [ label = "255uS passed" ];
    CHK_EOI -> WAIT_ACK [ label = "CLK=0->1" ];
    EOI_TO -> WAIT_ACK [ label = "CLK=0->1" ];
    WAIT_ACK -> WAIT_BIT [ label = "CLK=1->0" ];
    WAIT_BIT -> WAIT_BIT [ label = "CLK=1->0,bits<8" ];
    label = "receive";
  }
  WAIT_BIT -> IDLE [ label = "CLK=1->0,bits=8,ATN=1" ];
  WAIT_BIT -> CMD_IDLE [ label = "CLK=1->0,bits=8,ATN=0" ];
  subgraph cluster_1 {
    rank=same;
    TALK_PREP-> BUS_RELEASE	[ label = "CLK=0->1" ];
    BUS_RELEASE -> BUS_ACK	[ label = "80uS passed" ];
    BUS_ACK -> PREP_SEND	[ label = "DATA=0->1,Not last byte" ];
    BUS_ACK -> EOI	[ label = "DATA=0->1,last byte" ];
    EOI -> EOI2	[ label = "DATA=1->0" ];
    EOI2 -> PREP_SEND	[ label = "DATA=0->1" ];
    PREP_SEND -> PREP_BIT	[ label = "40uS passed" ];
    PREP_BIT -> SEND_BIT	[ label = "60uS passed" ];
    SEND_BIT -> PREP_BIT	[ label = "bits<8,60uS passed" ];
    SEND_BIT -> ACK	[ label = "bits=8" ];
    ACK	-> ACK_WAIT [ label = "60uS passed" ];
    ACK_WAIT-> BUS_ACK [ label = "DATA=1->0,not last byte" ];
    label = "send";
  }
  ACK_WAIT-> IDLE [ label = "DATA=1->0,last byte" ];
  ACK_WAIT-> IDLE [ label = "1000uS passed" ];
}


-- 
Jim Brain
brain@jbrain.com



       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.