PICAXE & Philips EE: Two-wire "SerialPower" Network
Version V2.0 (September 2007)
This page presents information on a true two-wire network between intelligent PICAXE-powered network nodes.
The network has the following aspects:
- Power and data are distributed over just two wires that are interchangeable; only the master node provides for power.
- Network communication is bi-directional, allowing communication between any pair of processes distributed over any number of nodes,
- All nodes are similar in that they catch all network messages and process them in a equal fashion,
- The network can be realized in a practical setting spanning several tens of meters,
- An "intelligent" master node roams the network for sending processes and registers them automatically,
- The protocol is efficient in that it allows small microcontrollers (PICAXE-08M) to implement both functional behavior as well as a full-fledged network stack.
- Simple "diode-mixing" networks with separate lines for communication and power provision are supported as well.
A more detailed summary of features is given at the end of this page.
Version V2.0 is a significant update of V1.3, including:
- Fully automatic registration and provision of timeslots for up to 48 sending slave processes
- On-the-fly registration or removal of new timeslots (e.g because of some sensor condition or tripped switch)
- Plug & Play slave node support (including dynamic process ID assignment)
- possibility to use simple, "diode mixing" network hardware where separate power and communication lines are used.
- Support for Network Manager Node for automatic removal of unused timeslots and on-the-fly message CRC checking
Hardware view
Logical view: communication between processes
COPYRIGHT NOTICE:
Copyright (C) 2007, Jurjen Kranenborg
This work is licensed under the Creative Commons
Attribution-Noncommercial-Share Alike 2.5 (Swedish port).
To view a copy of this license, you may press on the logo. You may alternatively also visit
http://creativecommons.org/licenses/by-nc-sa/2.5/se
To view a translation of this license in English, visit:
http://creativecommons.org/licenses/by-nc-sa/2.5
or send a letter to
Creative Commons,
171 Second Street, Suite 300,
San Francisco, California, 94105, USA.
In short form (me, my = holder of copyright):
- You may use, adapt, and distribute this work
- You must give credit to me when using this code in your application
- If you use my code commercially, I want my share
- You may share your adapted code (now with you as holder of copyright) on the condition that the same license conditions are applied
In order to acknowledge Jurjen Kranenborg (i.e. not the copyright holder of any derived work) as the architect of the original network concepts, please include the following (or similar) statement in all derived works (code, webpages, docs, etc.):
The network architecture was originally developed by Jurjen Kranenborg.
The specification document that gives a detailed description is available via the following link:
All information on the previous main release (V1.3) is still available via:
Application areas:
- Home monitoring systems: Examples of useful applications include energy monitoring (temperature and light), climate regulation, safety monitoring and local traffic monitoring.
-
Weather monitoring: outdoor intelligent sensors can be placed at different locations to report on meteorological conditions.
- Information presentation: Information can be presented easily at several locations, possibly dependant on local context.
-
Model railway automation: Trafficking light signals and large amounts of passage detection sensors and/or switches can be managed and powered without complex wiring in tough-to-reach environments where battery replacement is difficult. Furthermore, the network concept allows easy extension with new nodes.
-
Robot design: Multiple sensors and actuators and switches can be managed with reduced wiring effort. Although the network is not designed for operations that require large power consumption suddenly (starting up motors for example), the backup capacitor in slave nodes can be replaced directly by a local power source, while communication occurs over the network as usual.
-
Sensor fusion networks: Powerful high-level sensors can be built that integrate many physical sensor types in an intelligent node.
-
Beacon networks: A networked set of beacons can be developed that supports IR or ultrasound bi-directional communications with local modules, allowing the latter to perform out-of-sight communications. Also various applications in robotics can be thought of, like for example position determination.
The software routines referred to in the specification document are availabe in this section.
Code from documented examples can be found here (Note that in V2.X the master node does not need re-programming as it roams for and registers sending slave processes itself just after network power-up!):
If the simple "diode-mixing" network of Chapter 7.3 is used (instead of the combined power+data network) , then the following variants for the network stack and applications apply. Only slave node implementations are given; the master node code is identical with the SerialPower network version. Be careful NOT to use the routines below with the original SerialPower slave hardware (i.e. combined power and data), as this will destroy the network intefrace circuit due to different polarities. Furthermore, the implementations below assume separate network input and output pins.
The list below gives a more detailed overview of features of the network:
- Multi-drop bi-directional network (half-duplex), allowing information transfer between any combinations of nodes. Nodes that only "listen" (i.e. do not have sending processes) may be implemented with reduced hardware and software complexity.
- The concept of communicating processes is used (each process has a unique identifier), allowing abstraction from physical nodes and thereby flexible distribution of functionality over different nodes. A node may implement several processes, and the same process may run concurrently on several nodes with local modifications. As a result extremely flexible nodes can be designed that can be reconfigured via the network. Data is transferred over the network using a data-frame containing the caller process identifier, the calling process information and a number of data bytes. The network protocol completely abstracts form the underlying network hardware, allowing the application of very simple “diode mixing” network hardware with separate power and communication lines as well..
- Data transfer and power delivery to nodes over the same two lines (no additional GND or handshaking lines!), to which an unlimited number of nodes can be connected in any fashion. Consequently, the network complexity and software complexity does not scale with the number of nodes.
- The network connections are non-polarized, i.e. any node can be connected in any fashion to an existing two-wire network using two identical and interchangeable wires.
- The master node provides for power (delivered by default), all slave nodes have a local capacitor for uninterrupted operation when the network is pulled low during communications or interrupts.
- All nodes contain a PICAXE-08M or PICAXE-18X microcontroller to implement the network (requiring only a small part of the available program memory) as well as functional behavior (for example for sensing, switching or signaling purposes).
- The network protocol implementation is strongly based on interrupt handling, allowing the nodes to concentrate on functional operation for most of the time. All nodes read all data frames on the network, but quickly return to normal operation if they do not implement one of the processes relevant to the particular data frame.
- The network stack is implemented with an “intelligent” master node that roams
for sending slave processes, and auto-registering slave nodes that respond with the IDs of their sending processes. Thus, the master node becomes completely application independent (avoiding reprogramming) and focuses on timeslot provision. Additionally, the master node provides for processes to add extra timeslots for other slave processes that wish to send, allowing “Plug & Play” slave nodes to be added on the fly.
- Simple and cheap circuitry for network electrical implementation using solid state components only (no analog components like transformers used).
- The network concept can be extended in many ways, like adding CRC checking, prioritized node timeslot assignment, interrupting slave nodes, longer data frames, adding node specific processes for energy consumption regulation etc.
- Energy consuming nodes that need their own energy source can be used without modifications.
- Minimum setup of two nodes is possible in which the master node implements functional processes as well (at the penalty of some network bandwidth reduction).
- On a PICAXE-08M slave node a full network stack requires 139 bytes of EEPROM (out of 256 bytes). A slave that does not have sending processes can have a reduced network stack of only 55 bytes
- Although extremely well suited to the PICAXE microcontroller, other types of microcontroller can be applied in network nodes as well (in particular those that can operate below 5V).