Difference between revisions of "4E Network"

From SlugWiki
Jump to: navigation, search
m
Line 1: Line 1:
 +
==Introduction==
 
As the number of planned projects increased, it became clear that we needed a set of standards which would allow them to communicate with a central computer and each other. It is not practical to have a separate computer, separate wiring, and a separate communications protocol for every project. The 4E network will allow all the projects to share these things.
 
As the number of planned projects increased, it became clear that we needed a set of standards which would allow them to communicate with a central computer and each other. It is not practical to have a separate computer, separate wiring, and a separate communications protocol for every project. The 4E network will allow all the projects to share these things.
  
Line 5: Line 6:
 
Each PIC will be its own node, so a project may have multiple nodes. For example, [[Bemix]] version 3 will have one node for each bathroom. On the other hand, a single node may be associated with multiple projects. The control panel will provide a physical interface to most 4E projects.
 
Each PIC will be its own node, so a project may have multiple nodes. For example, [[Bemix]] version 3 will have one node for each bathroom. On the other hand, a single node may be associated with multiple projects. The control panel will provide a physical interface to most 4E projects.
  
Each node will have a unique address and will filter incoming data and only listen to packets that are addressed to it. A 9 bit byte scheme is currently planned. In addition to the usual 8 bits, there will be a nineth bit which will designate whether the byte is data or an address. Thus, each node need only watch the nineth bit continuously rather than all eight. Many PICs have built a built in hardware implementation of this.
+
Each node will have a unique address and will filter incoming data and only listen to packets that are addressed to it.
 
+
Each packet will have the following:
+
*8 bit destinination address--the nineth bit is 1 here and 0 everywhere else
+
*8 bit source address
+
*8 or 16 bit packet length
+
*8 bits for future expansion
+
*data
+
*checksum
+
  
 
The 4E network will most likely be full duplex, meaning that a node can transmit and recieve at the same time. It is unclear whether it is better to have the computer poll each node or to implement some collision avoidance system.
 
The 4E network will most likely be full duplex, meaning that a node can transmit and recieve at the same time. It is unclear whether it is better to have the computer poll each node or to implement some collision avoidance system.
  
Many PICs have a self programming feature, meaning that they can write to their own program memory.  Ideally, the PICs would be initially loaded with some software that would have the 4E network protocal and means for self programming. Any modification to the software could be made remotely over the 4E network, without ever needing physical access to the PIC.
+
 
 +
==Packet Format==
 +
Each packet consists of an 8 byte header and up to 256 bytes of data, along with escape sequences to separate the parts:
 +
 
 +
{| border="1"
 +
|-
 +
| '''Size'''
 +
| '''Contents'''
 +
|-
 +
| 1
 +
| escape
 +
|-
 +
| 1
 +
| header code
 +
|-
 +
| 8
 +
| header
 +
|-
 +
| 1
 +
| escape
 +
|-
 +
| 1
 +
| data code
 +
|-
 +
| 0-256
 +
| data
 +
|-
 +
| 1
 +
| escape
 +
|-
 +
| 1
 +
| end code
 +
|}
 +
 
 +
The header is shown below:
 +
{| border="1"
 +
|-
 +
| '''Byte'''
 +
| '''Contents'''
 +
|-
 +
| 1
 +
| destination address
 +
|-
 +
| 2
 +
| source address
 +
|-
 +
| 3
 +
| version
 +
|-
 +
| 4
 +
| length of data
 +
|-
 +
| 5
 +
| 0
 +
|-
 +
| 6
 +
| 0
 +
|-
 +
| 7
 +
| 0
 +
|-
 +
| 8
 +
| 0
 +
|}
 +
 
 +
 
 +
 
  
 
Check out more [[projects]] going on around 4e.
 
Check out more [[projects]] going on around 4e.

Revision as of 19:32, 12 January 2006

Introduction

As the number of planned projects increased, it became clear that we needed a set of standards which would allow them to communicate with a central computer and each other. It is not practical to have a separate computer, separate wiring, and a separate communications protocol for every project. The 4E network will allow all the projects to share these things.

The network will use RS485 serial. This standard was chosen because it allows for multiple nodes to be connected to a single cable run. It is also extremely easy to interface with serial on computer and a PIC.

Each PIC will be its own node, so a project may have multiple nodes. For example, Bemix version 3 will have one node for each bathroom. On the other hand, a single node may be associated with multiple projects. The control panel will provide a physical interface to most 4E projects.

Each node will have a unique address and will filter incoming data and only listen to packets that are addressed to it.

The 4E network will most likely be full duplex, meaning that a node can transmit and recieve at the same time. It is unclear whether it is better to have the computer poll each node or to implement some collision avoidance system.


Packet Format

Each packet consists of an 8 byte header and up to 256 bytes of data, along with escape sequences to separate the parts:

Size Contents
1 escape
1 header code
8 header
1 escape
1 data code
0-256 data
1 escape
1 end code

The header is shown below:

Byte Contents
1 destination address
2 source address
3 version
4 length of data
5 0
6 0
7 0
8 0



Check out more projects going on around 4e.