Understanding IsoPod™ What is IsoPod™? Real Time Controller –IsoMax™ for Multitasking –DSP...
-
Upload
anna-thomas -
Category
Documents
-
view
218 -
download
0
Transcript of Understanding IsoPod™ What is IsoPod™? Real Time Controller –IsoMax™ for Multitasking –DSP...
Understanding IsoPod™
What is IsoPod™?• Real Time Controller
– IsoMax™ for Multitasking– DSP Core for speed, 40 MIP’s– Motion Control features: PWM, Quadrature,
Timers, A/D, GPIO, 2 SCI, 1 SPI, etc.
– Networking features: CAN Bus V2.0A/B
• Size: 1.2” x 3.3”• Price: $99 single qty.
IsoPod™ Overview
Hardware
Software
Applications
Connectors
Packages
Select a link to the left to skip ahead to a topic
orcontinue to the next page
to see them all
IsoPod™ Overview
• Here is a larger view of the graphic.
1. Hardware Feature: LED’s
• Three On Board LED’s– Red– Yellow– Green
2. Hardware Feature: GPIO
• 16 General Purpose Input Output lines– PA0 - 7– PB0 – 7– Programmable edge sensitive inputs
3. Hardware Feature: SCI
• Serial Communication Interface (SCI) full-duplex serial channel– One RS-232
– One RS422/485
– Programmable Baud Rates, • 38,400
• 19,200
• 9600
• 4800
• 1200
4. Hardware Feature: SPI
• Serial Peripheral Interface (SPI)– Full-duplex synchronous operation on four-
wire interface– Master or Slave– Programmable # of bits
5. Hardware Feature: A/D
• 8-ch 12-bit AD– Continuous Conversions
• 1.2us (6 ADC cycles)
– Single ended or differential inputs– ADC can be sync’d with PWM
6. Hardware Feature: PWM
• 12-channel PWM module – 15-bit counter with programmable resolutions
down to 25ns– Twelve independent outputs,– or Six complementary pairs of outputs, or
combinations– 8 Fault Inputs– 6 Current Status inputs
7. Hardware Feature: Timers
• Sixteen Timers (eight may be used in quadrature)– 16-bit timers– Count up/down, Cascadable– Pair for simple quadrature– Pair for step and direction– Programmable as input capture or output compare – Input capture trigger rising edge, falling edge, or any
edge – Output capture action
Set, reset or toggle – External sync input
8. Hardware Feature: Quad.
• Two Quadrature Decoder (uses eight timers)– 32-bit position counter– 16-bit position difference register– 16-bit revolution counter – 40MHz count frequency (up to)– Logic to decoder quadrature signals – Configurable digital filter
for inputs – Watchdog timer
to detect stalled shaft
9. Hardware Feature: CAN
• CAN 2.0 A/B module for networking– Programmable bit rate up to 1Mbit: Multiple boards
can be networked (MSCAN)
– Ideal for harsh or noisy environments, like automotive applications
– CAN is a serial bus system especially suited to interconnect smart devices to build smart systems or sub-systems.Ref:http://www.can-cia.org/can/
10. Hardware Feature: JTAG
• JTAG port for CPU debugging– Examine registers, memory, peripherals– Set breakpoints– Step or trace instructions
11. Hardware Feature: COP
• Watch Dog Timer
• COP module
• Low Voltage Detector for Reset– S80728HN
12. Hardware Feature: PWR
Processor has special operating modes:
• Low Voltage Mode
• Stop Mode
• Wait Mode
13. Hardware Feature: DRV
On Board level translation for
• RS232: MAX3221
• RS422: MAX3483
• CAN: TJA1050 CAN Transceiver
14. Hardware Feature: REG
On Board Voltage Regulation
• LM2937 5V
• LM3940 3.3V
Connector OverviewJ1 Ser., Power, General
Purpose I/OSerial, Power, Ports PA0 – PA7, PB0 – PB7
J2 JTAG connector CPU Port
J3 SPI SCLK, MISO, MOSI, SS, PD0, PD1, PD2, PD3
J4 RS-422/485 Serial Port -RCV, +RCV, -XMT, +XMT
J5 CAN BUS Network Port CANL, CANH
J6 Servo Motor Outputs x 12 PWM, +V, GND
J7 Motor Encoder x 2 Quadrature, Fault0, Fault1, Fault2, IS0, IS1, IS2
J8 A/D Various A/D0 – A/D7, Various
Connector J1Ser., Power, General Purpose I/O+VIN 24 1 SOUT
GND 23 2 SIN
RST’ 22 3 ATN’
+5V 21 4 GND
PA0 20 5 PB0
PA1 19 6 PB1
PA2 18 7 PB2
PA3 17 8 PB3
PA4 16 9 PB4
PA5 15 10 PB5
PA6 14 11 PB6
PA7 13 12 PB7
Connector J2JTAG connector
+3V 1 2 GND
TDI 3 4 GND
TDO 5 6 TMS
TCK 7 8 DE
RESET’ 9 10 TRST
Connector J3SPI
+3V 1 2 GND
PD0 3 4 SCLK
PD1 5 6 MOSI
PD2 7 8 MISO
PD3 9 10 SS’
Connector J4 RS-422/485 Serial Port
N.C. 1 2 N.C.
+RCV 3 4 -RCV
GND 5 6 GND
-XMT 7 8 +XMT
N.C. 9 10 N.C.
Connector J5CAN BUS Network Port
N.C. 1 2 N.C.
CANL 3 4 CANH
N.C. 5 6 GND
N.C. 7 8 N.C.
N.C. 9 10 N.C.
Connector J6 Servo Motor Outputs x 12
Sig. +V GND
PWMB5 1 2 3
PWMB4 4 5 6
PWMB3 7 8 9
PWMB2 10 11 12
PWMB1 13 14 15
PWMB0 1 6 17 18
PWMA5 19 20 21
PWMA4 22 23 24
PWMA3 25 26 27
PWMA2 28 29 30
PWMA1 31 32 33
PWMA0 34 35 36
Connector J7Motor Encoder x 2
+5V 24 1 FAULTA0
GND 23 2 FAULTA1
TA0 PHA0 22 3 FAULTA2
TA1 PHB0 21 4 ISA0
TA2 IND0 20 5 ISA1
TA3 HM0 19 6 ISA2
+5V 18 7 FAULTB0
GND 17 8 FAULTB1
TB0 PHA1 16 9 FAULTB2
TB1 PHB1 15 10 ISB0
TB2 IND1 14 11 ISB1
TB3 HM1 13 12 ISB2
Connector J8A/D Various
ANA0 24 1 +5V
ANA1 23 2 IRQA’
ANA2 22 3 IRQB’
ANA3 21 4 FAULTB3
ANA4 20 5 FAULTA3
ANA5 19 6 PD5
ANA6 18 7 TC0
ANA7 17 8 TC1
VSSA 16 9 CLKO
VREF 15 10 RSTO’
GND 14 11 RD’
V+ 13 12 WR’
IsoPod™ comes with IsoMax™
Other Languages
The IsoPod™ can be programmed in languages other than IsoMax™.
• Metrowerks sells Code Warrior, a professional level C language IDE
• Max-FORTH is available now from NMI.
• Small C is under development
• Assembler is under development
• BASIC is planned for the future
Real Time Programming
A real time program is one that waits.
Any program that does not wait on something is not a real time program.
Any program that waits on something, other than the program itself, is a real time program.
Conventional Language
In an ordinary high level language, such as C, BASIC, FORTH or JAVA, programs are written flowing from top to bottom. Flow charts are the preferred diagramming tools. A program that must wait on something, simply loops in place. Most conventional languages follow the structured procedural programming paradigm. Structured programming enforces this style of waiting.
Program Counter Capture (PCC)
The Program Counter Capture, is when the program branches backwards on itself to wait. In Structured Programming, the Program Counter Capture is used to implicitly hold state (wait) information. This information is better kept elsewhere (explicitly).
Conventional Multitasking
In a conventional language getting several things done at the same time is tricky. Most programmers must use a Real Time Operating System. A Multitasking Operating System adds much overhead and complexity for switching tasks/contexts.
Concept of Isostructure
The word, Isostructure, has two roots: Iso, meaning equal or “on the same level,” and structure, from the current usage in the Computer Science. Isostructure is structure with no backwards branches, and an enhanced way to branch in multiple forward directions (called polyfurcation) similar to a case statement.
Multitasking vs. Isostructure
turn onheater a
room atoo cold?
room atoo hot?
yes
yes
turn offheater a
start
heatera off?
yes
turn on heater
too cold?
too hot?no
no
turn off heater
start
If Program Counter Capture (PCC) Loops can be avoided, compatible thread-like programs can be interwoven.
Isostructure and Flow Charts
A simple structured flow chart can sometimes be replaced by alternatively styled Isostructured flow charts as shown above. Complex flow charts are too difficult. Structured program was intended to end spaghetti code. Non Isostructure can lead to unruly intertwines of if-then statements. A different programming paradigm is needed.
Finite State Machines
A better way to represent a real time program is with a Finite State Machine. IsoMax is a programming language based on Finite State Machine (FSM) concepts applied to software, with a procedural language (derived from Forth) underneath it. The closest description to the FSM construction type in IsoMax™ is a “One-Hot” “Mealy” type of Timer-Augmented Finite State Machines.
New Paradigm
IsoMax™ is a new language. Why learn a new language? Because the old languages cannot do what IsoMax™ can. Old languages are based on, and reinforce, structured programming. IsoMax™ is based on Isostructured programming. No other language has fully interactive, high-level, real time programming.
IsoMax™ has a new programming paradigm, simply not available any where else.
IsoMax™ Language
The breakthrough in IsoMax™ is the language is inherently “multitasking” without the overhead or complexity of a multitasking operating system (no PCC’s allowed). In IsoMax™ anyone can write simple machines and string them together so they work.
IsoMax™ Programming
You can draw state diagrams instead of flow charts, and then translate the diagrams directly into their state machine equivalents. To program in IsoMax™ you use text to create state machines. The state machines machines can then run in the Virtually Parallel Machine Architecture (VPMA).
IsoMax™ Machines
Each machine in the program is like a hardware component in a mechanical solution. When satisfied with its performance, you install the new machine in a chain of machines. The machine becomes a background feature of the IsoPod™ until you remove it. All tasks are handled on the same level within the machine chain, each running like its own separate little machine.
Create the machine
There are five steps to creating a machine in IsoMax™ text:
• Name the machine
• Identify the machine
• Append states to the machine
• Describe transitions between states
• Test and install
Name the machine
The first program line, tells IsoMax™ to add a new virtual machine. (Any group of characters without a space or a backspace or return will do for a name. Use up to 32 characters. Here the syntax is MACHINE followed by the chosen name.)MACHINE <name1> State Flowchart
Identify the machine
Second program line, identify as the machine to append to. The syntax to do this is to say ON-MACHINE and the name of the machine to work on, which looks like this:ON-MACHINE <name1>
State Flowchart
Append states to the machine
States are the fundamental parts of our virtual machine. A state is a place where the computer’s outputs are stable, or static. Said another way, a state is place where the computer waits. Add states to the machine with a name. The syntax is APPEND-STATE followed by another made-up name.
APPEND-STATE <name2>APPEND-STATE <name3>etc.
State Flowchart
States Are Waits
A real time program is one that waits. A state machine has states, which are explicit places where machines wait.
States are static.
States are not where the processor “does” something, they are where the processor “doesn’t” do anything, but wait… except to see if it is time to stop waiting.
Describe transitionsbetween states
State Flowchart
The rule for changing states along with the action to do, if the rule is met, is called a “Transition”. A transition contains: - the name of the “State” the rule applies to.- the rule, which is called the “Condition”; this is the “when to stop waiting”- the action; “the what to do then” - the name of the “State” to go to is “where to wait after that”.
Transition syntaxas normally used
IN-STATE
<name of state>
CONDITION
<procedural Boolean>
CAUSES
<procedural action>
THEN-STATE
<name of next state>
TO-HAPPEN
Transition syntaxwith extra comments
IN-STATE ( the State the rule applies to )
<name of state>
CONDITION ( when to stop waiting )
<procedural Boolean>CAUSES ( what action to do )
<procedural action>THEN-STATE ( where to wait after that )
<name of next state>
TO-HAPPEN ( ends this Transition definition )
Transitions Details
A transition has four components;.
1) which state it starts in2) the condition necessary to leave3) the action to take when the condition becomes true4) the state to go to. ;.
Why are transitions so verbose? The structure makes the transitions easy to read in human language. ;.
The constructs IN-STATE,CONDITION,CAUSES, THEN-STATE, and TO-HAPPEN are like the five brackets around a table of four things.
Test and install
IsoMax™ is interactive. The machine can be defined and tested in the foreground, and once performance is assured, it can be installed in the machine chain to run with all other machines in the background scheduled machine list. To truly understand IsoPod™ requires understanding how interactivity speeds development. Test the code as it runs, where it runs, while it runs, in real time.
Sample Machine:Thermostat
A thermostat makes a convenient example. The machine is named, Thermostat1.
MACHINE Thermostat1
The machine is identified, ON-MACHINE Thermostat1
The states added, APPEND-STATE Wait-on-low-temp
APPEND-STATE Wait-on-high-temp
Sample Transitions:Thermostat
IN-STATE
wait-on-low-temp
CONDITION
too-cold?
CAUSES
heater-on
THEN-STATE
wait-on-high-temp
TO-HAPPEN
IN-STATE
wait-on-high-temp
CONDITION
too-hot?
CAUSES
heater-off
THEN-STATE
wait-on-low-temp
TO-HAPPEN
The State Diagram
State Machine program execution can easily be made to be multitasking.
State diagrams contain more information with less confusion.
State Flowchart
Equivalent State Diagramfor Thermostat
w ait_onlow _tem p
w ait_onhigh_tem p
hearter_on
too_cold?
hearter_off
too_w arm ?
Sample ComparisonElements in all 3 Chart
1. Wait until too cold
2. Action when too cold (heater on)
3. Where to go next
4. Wait until too hot
5. Action when too hot (heater off)
6. Where to go next
7. Condition for leaving (too cold)
8. Condition for leaving (too hot)
Sample Comparison 1 of 3State Machine vs. Flow Chart
w a i t _ o n
l o w _ t e m p
w a i t _ o n
h i g h _ t e m p
h e a r t e r _ o n
t o o _ c o l d ?
h e a r t e r _ o f f
t o o _ w a r m ?
1
2
4
5
3
6
7 8
Sample Comparison 2 of 3 Isostructured Flow Chart
tu rn on
hea te r a
room a
too co ld?
room a
too ho t?
yes
yes
tu rn o ff
hea te r a
s ta rt
hea te r
a o ff?
yes
12
45
3
6
78
Sample Comparison 3 of 3 Structured Flow Chart
turn on heater
too cold?
too hot?no
no
turn off heater
start
1
2
4
5
3
6
7
8
Sample Comparison of ElementsState Machine vs. Flow Chart
turn on heater
too cold?
too hot?no
no
turn off heater
start
1
2
4
5
3
6
7
8
turn onheater a
room atoo cold?
room atoo hot?
yes
yes
turn offheater a
start
heatera off?
yes1 2
4 5
3
6
78
wait_onlow_temp
wait_onhigh_temp
hearter_on
too_cold?
hearter_off
too_warm?
1
2
4
5
3
6
7 8
Typical IsoPod™ Applications
• Real Time control• Embedded DSP• Instrumentation• Process Control• Network Control• SCADA• Motion Control• Robotics!
Typical Mobile Robot 1:Hexapod: 6 legged walker
• Locomotion: 18 RC Servos– 12 Hardware PWM 4 Timer PWM
• Ranging: 2 RC Servos Pan and Tilt– 2 Timer PWM– 1 Timer pulse measurement
• Foot sensors– 6 A/D channels: Pressure
Typical Mobile Robot 2:Roller: RC Servo
• Locomotion: 2 RC Servos– 2 Hardware PWM
• Ranging and Sensing– up to 10 sensors on RC Servos– 13 Timers for pulse measurement– 8 A/D channels
Typical Mobile Robot 3:Roller: DC Servo
• Locomotion: 2 DC Servos– 8 Hardware PWM– 2 Quadrature feedback (4 Timer lines)
• Ranging: up to 4 sensors on RC Servos– 5 Timers for pulse measurement– 8 A/D channels
T.B.D.
Simple connection
Hook up for development and programming.
IsoMax™ Communications
Programming and interaction with Isomax™ software is text based via the serial channel. A simple terminal program on PC makes efficient development system. Text can be hand entered via terminal, copied from a text editor, or downloaded from a file (*.txt). It’s easy!
MaxTerm program available for download, from NewMicros.
Sample of Maxterm Screen
Sample of Words on Maxterm Screen
Sample of Programming on Maxterm Screen
Sample of Maxterm Help Screen
IsoPod™
Board by itself w/IsoMax™ installed.
(without cable or transformer)
• Price $99
Order Page
Quick Kit
Quick Kit provides IsoPod™, custom made serial cable and DC wall transformer with special connector. Price: $114
Order Page
Development Kit
Development Kit provides IsoPod™, Controller interface board with 2.4" x 3.6" breakable prototype area, serial cable and wall transformer
• Price: $149Order Page
END
“One Hot”
• "One Hot" is a description of an optimization of a state machine in hardware that has an output per state. So rather than the state number being a combination of bits, like a counter, which points to a state, there is one unique output per state.
more on web more on web BACK
“One Hot” continued
• IsoMax™’s software equivalent is the state number. IsoMax™ uses precomputed GOTO’s. When the scheduler executes a machine, it doesn't have to test the state number to find which state it is in, but vectors directly to it. It is the only “hot” state.
BACK
“George H. Mealy”
• "Mealy" was a pioneer in state machine descriptions (1955). Usually a machine is described as either “Mealy” or “Moore” machine, depending on how outputs are done. Moore thought the states themselves do the output (more suitable to a hardware implementation). Mealy thought the transitions do the output (more appropriate for software).
BACK
“Mealy” continued 1
For IsoMax™ the Mealy machine design is preferred on principle. If a state is a wait, and static as its name implies, it shouldn't be doing anything active (no outputs). Doing something active (making or changing outputs) should be limited to the transition between states (Mealy, not Moore).
BACK
“Mealy” continued 2
In a Mealy machine, the transitions do the output. So the state number wasn't necessarily the output. Consequently, a Mealy machine can have two states with identical outputs, but a different state number. A Moore machine cannot.more on web
BACK
Timer-Augmented
Rodney Brooks of MIT AI Lab fame prefers Finite State Machines for modeling robot behavior. But he likes to augment the FSM’s with timers. He calls these Timer-Augmented Finite State Machines. Timers in the IsoPod™ and LOOPVAR’s in IsoMax™ can be used to augment the FSM’s in this way.
BACK