slide 1 worstell@ copper.net robust low-power msp430 networking with a buffer insertion ring glen...
Post on 18-Jan-2016
217 Views
Preview:
TRANSCRIPT
Slide 1
worstell@copper.net
Robust Low-Power MSP430 Networking with aBuffer Insertion Ring
Glen Worstell
Sugle Consulting
worstell@copper.net
More info:
www.worstell.com
Slide 2
worstell@copper.netAgenda
• Application areas for small networks
• Common small network solutions
• The “Buffer Insertion Ring” network Protocol MSP430 Hardware MSP430 Software
• Comparison of BIR with other solutions
• Description of BIR demonstration code
• Q&A
Slide 3
worstell@copper.netSmall network applications
• Auto and other vehicle data & control LIN commonly used
• Industrial process control
• Lab data collection
• Home automation
• Medical data collection
• HVAC
Slide 4
worstell@copper.netCommon Micro Networks
• CAN Multi-Master 1Mbps 8 Byte Messages
• LIN Master-Slave (sort of) 20K bps 8 Byte Messages
• BIR Multi-Master 50K bps 8 Byte Messages
• Home-grown RS-485
Slide 5
worstell@copper.netWhy BIR?
Extremely low idle power Isolated (with isolated power supply) Lowest cost, esp. in small quantities Uses available hardware (UART) Low EMI generation Low EMI susceptibility Multi-master Can use with other micros (but not low power)
Slide 6
worstell@copper.netWhy not BIR?
• Can’t disable interrupts for very long But could use 2nd MSP430
• Requires Xtal But could use LIN-like scheme
• 1 Byte latency per node About 1 Msec per node at 10K baud
Slide 7
worstell@copper.netBIR Concept
• Unique node numbers
• Node sends message (to all other nodes) whenever necessary
• Asynchronous serial node transceivers Built-in UART Bit-Bang (F1121)
• 4-Wire Cable (RJ-11?) Power, Ground Balanced pair BIR data 2 to 32 nodes
• Optical Isolators
Slide 8
worstell@copper.netBIR message format
Slide 9
worstell@copper.netTransceiver Hardware
Slide 10
worstell@copper.net9-bits/byte Message Format
• Address Byte Node Number of Sender (5 bits) Number of Data Bytes (2 bits) Parity (1 bit)
• Data Byte (8 bits)
• Extra Data Bytes (8 bits each)
• Checksum (8 bits, like LIN or CRC-8)
Slide 11
worstell@copper.netNumber of Data Bytes Coding
• 0: One Data Byte
• 1: Two Data Bytes
• 2: Four Data Bytes
• 3: Eight Data Bytes
Slide 12
worstell@copper.netInsertion Buffer Idea
• Each node has a buffer
• Incoming data goes in buffer
• To Send: If buffer is empty, put message into buffer Otherwise, wait until it is empty
• Messages from other nodes are passed on
• Messages from this node are not passed
• A note about baud rate divisors If small n, n should be odd
Slide 13
worstell@copper.netBIR software flowchart
Slide 14
worstell@copper.netThe Three-node Demo
• Each node sends to a random other node
• Sending occurs at random intervals
• Random message:” turn on LED” or “turn off LED”
• Stop blinking for one minute if any error is detected
• Source code on web
• Uses simple RTOS and “Random” number generator
Slide 15
worstell@copper.netDemo photo
• BIR demo - 2 HW UART, 1 Timer-A UART
Slide 16
worstell@copper.netAn RTOS for limited RAM
• Single Stack
• Cooperative
• Standard C
• See “Salvo” for similar scheme
• Source code on web www.worstell.com
Slide 17
worstell@copper.netBasic RTOS idea
• Suspend only from Main()
• Nothing is on the stack
• Need to save only the return address
• See “ProtoThreads”, Adam Dunkels, www.sics.se/~adam/pt/
Slide 18
worstell@copper.net
A good PRNG without hardware multiply• Poor PRNGs are very common
Feedback shift registers arithmetic modulo a power-of-2
• “Random Number Generators - Good Ones are Hard to Find” Park ,SK & KW Miller, CACM, Oct. 1998 X(n+1) = (A*X(n)+B) mod M
• Multiplicative, Congruential Random-Number Generators with Multiplier +- 2^K1 +- 2^K2 and Modulus 2^P - 1, Pei Chi Wu, ACM Trans. On Mathematical Software, June 1977
Slide 19
worstell@copper.netQ&A
• Email: worstell@copper.net
• More info, source code: www.worstell.com
top related