R/Evolution NET001 User manual

PICAXE NET SERVER (NET001)
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
NET001.PMD
NET001 Starter Pack Contents:
NET002 PICAXENet Server
NET006 PICAXENet Demo Board Kit
CAB010 RS232 Serial Cable
CAB005 CAT5 patch cable (blue colour)
CAB006 CAT5 crossover cable (grey colour)
AXE022P PICAXE-28X protoboard pre-fitted with
AXE010X PICAXE-28X microcontroller
NET004 16 pin IDC cable
Also required (not supplied):
PWR009 9V DC power supply (2.1mm tip positive) (PWR009 is for UK use only)
Optional:
USB010 USB to serial adapter
HUB001 Network 10/100 5 Port Switch
CAB005 CAT5 patch cable (for use with switch)
Optional add-ons:
SPE020 Speech Synthesizer (use with CON043 connector)
MIC052 PCF8570P RAM
PC Requirements:
To connect to the PICAXENet Server you will require a PC/laptop fitted with a 10/100 ethernet card (8 pin
RJ45 connector, normally marked with a network symbol). Most modern computers are fitted with this
type of network port as standard. If your computer is not fitted with a network card an external USB-
Ethernet adapter may be required. These are available at low cost from computer stores.
Overview:
PICAXENet Server (PNS) is an exciting new embedded microcontroller web server, designed to operate in
partnership with a PICAXEchip. This small (112 x 76mm) board acts as a stand-alone web-server without
the need for a computer. Special routines enable PICAXE-28X or 40X chips to exchange data with the web-
server, enabling dynamic real-time display of variable and input/output data on web pages broadcast from
the PICAXEnet server.
Typical applicationsinclude:
• Use as a stand-alone web server with updated input/outputs e.g. an environmental monitoring system
or weather station
• Use as a PICAXEintegrated web server, so that variables from a PICAXEcontrolled project can be
displayed on a web page over the internet.
• Use as an internet connection for a hardware project controlled by a PICAXEchip, so that the PICAXE
control program can be remotely updated via FTP.
Methodsof Use:
• Use as a stand-alone web server, with eight on-board configurable input/output pins, or
• Link to a PICAXE-28X or 40X chip and share memory space so that PICAXEvariables and input/output
pin conditions can be displayed on web pages served from the PICAXEnet server. The PICAXEchip can
also read the time from the PICAXEnet server real-time-clock and update messages on the LCD screen.

2
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Features:
• Control on-board outputs and LCD, respond to digital/analogue inputs, and
send data to or from the PICAXEchip via dynamically updated web pages
(HTTP with CGI scripting).
• On-board 24LC512 EEPROM to store web pages.
• Download a new website image to the onboard EEPROM memory via FTP
(password protected). Easy to use software wizard in the free Programming
Editor software (v4.1.16 or later) builds the EEPROM web image automatically
from .htm, .cgi and graphic/sound files.
• Direct link to the AXE022P proto board for easy intefacing to PICAXE-28X or
40X projects.
• Download a new program to an attached PICAXEchip over the internet via FTP
(password protected).
• Supports MAC, IP, ARP, ICMP (“ping”), TCP, HTTP, FTP and DHCP.
• Set IP address manually or via DHCP.
• On board real time clock with battery backup.
• On board (detachable) 16x2 LCD for user messages.
• 10BaseTsocket and network interface with diagnostic LEDs.
• Remote control of SPE030 speech synthesizer (purchase separately).
Layout:
The diagram below shows the main features of the PICAXENet Server.
Clock backup cell
i2c expansion port
power (9V) RS232 computer Network (10BaseT)
LEDs Reset
Mode switch
CONN5
(input/output)
port
IDC
16x2 LCD with contrast adjust

3
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Quick Start
Important – do not connect the AXE022 project board to the PNS until you have
checked the AXE022 jumper settings (see the AXE022 section of this manual for more
details). You do not need to connect the AXE022 or demo board for this quick start.
Please ensure you are using version 4.1.16 (or later) of the PICAXEProgramming
Editor software. Earlier versions of the software do not support the PNS. The
software update can be downloaded free of charge from the software page at
www.picaxe.co.uk
Step 1 – Connect the Network Cable
There are two ways to connect the PNSto your computer for testing. Method B is
recommended.
a) Direct Connection:
Use the grey CROSSOVER network cable to connect the PNSdirectly to your
computer’s network connector. Make sure the network adapter supports 10-BASET
connections (almost all network cards do, devices marked as “10/100” are also
compatible as they automatically support both Base10 and Base100). If your older
computer does not have a network connection, you will need to purchase a USB to
ethernet adapter from a high street computer store.
b) Connection via Switch, Hub or Router
Use the coloured (blue) STRAIGHT-WIRED network cable to connect the PNS
directly to your network hub/switch/router. Make sure the network supports the 10-
BASET protocol (devices marked as “10/100” are compatible as they automatically
support both Base10 and Base100).
Do not confuse use of the straight wired and crossover wired CAT 5 cables! Do not use the
grey crossover cable to connect to a router/hub/switch.
1) Direct connection
between PC and PNS
2) Network connection to
an existing switch or hub
3) Connection to a router
(integrated switch) with
a cable modem.
PC PNS
grey
crossover
PC PNS
blue
Switch
PC PNS
blue
Router
Modem

4
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Step 2 – Connect the RS232 Serial Cable and Power Supply
The serial cable is only required when setting up the default configuration settings
of the PNS using the Programming Editor setup wizard. It connects directly to your
computers 9 pin serial port. If you computer/laptop does not have a 9 pin serial
port you will also require a USB adapter, part USB010.
Connect a 9V DC regulated 2.1mm tip positive power supply (e.g. UKpart
PWR009) to the PNS. The LCD top line should display ‘PICAXENET v1.00’ (you
may need to adjust the LCD contrast setting using the preset at the front of the
PNS).
Step 3 - Set an IP address
All devices connected to a network, including the PNS, require a unique IP address
for identification.
When supplied new, the PNSis configured to automatically receive an IP address
using a DHCP type connection. With DHCP, the DHCP server (e.g. your router or
network server) allocates the PNS an IP address automatically when it is connected
to the network. If your system already supports DHCP the IP address (e.g. a number
similar to 192.168.0.10) will appear automatically on the PNSLCD screen a few
seconds after network connection. In this case you can now skip directly to step 4.
If you are connecting the PNS directly to the computer via the crossover cable, or
have a network that does not use DHCP, you must apply a static (fixed) IP address
to the PNS. To do this:
1) Connect the serial cable from the PNSto your computer
2) Make sure the Programming Editor software is setup to use the correct serial
COM port (using the View>Options>Serial port menu)
3) Click the PICAXE>Wizards>PICAXENet Server>Setup menu within the
Programming Editor software
4) Select the ‘Fixed IP’ option, enter the desired IP address and then click
‘Download’ to reconfigure the PNS to use a Fixed IP address. Follow the on-
screen instructions to complete the download.
Contact your network administrator if necessary to be allocated a fixed IP address.
Make sure the fixed IP address is unique on your network. See Appendix B for
further details about the use and selection of IP addresses.
Tip - If your computer is not on a network, and the computer is only connected to
the PNSvia the crossover cable, you could (in theory) use any IP address. However
it is recommended that you use the following ‘local network safe’ settings:
Computer IP: 192.168.0.5
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.5
PNS IP: 192.168.0.10
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.10

5
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Note that if you can instantly access the internet from your computer (other than
using a telephone dial up modem) the computer is probably already on a small
network! This network is, for instance, often created via your cable modem. In this
situation, if the cable modem only has a single network socket which connects
directly to your computer, you may need to add a ‘cable router’ to your system to
increase the number of ports available. Suitable cable router products that have
been fully tested with the PNSinclude Netgear RP-114, Netgear RP-614 and LinkSys
BEFSR41.
Step 4 – Try a Ping test
Your PNSshould now be displaying an IP address on the bottom line of the LCD
(e.g. 192.68.0.10). Within the Programming Editor software click the
PICAXE>Wizards>PICAXENet Server>Ping Test menu
Enter the IP address (as shown on the PNSLCD) and then
click ‘Ping’.
If all the network is correctly setup you should see a series
of 4 ping replies on screen almost instantly. This proves
your computer can ‘talk’ correctly to the PNSover the
network.
Note:- Internet Security / Firewall software. The first time you use the Programming
Editor software with the PNS you may get a warning message (such as that shown
in the figure below) if you are running a security/firewall application (sample
screenshot is of Norton Internet Security software). This is because the
Programming Editor software is ‘trying to talk’ over the network to the PNS.
However the security software does not actually know that the PNS is not a
computer, and so assumes that the software is trying to talk over the network/
internet to another computer. You must therefore ensure that your security software
allows the Programming Editor executable file (progedit.exe) to communicate on
ports 80 (http) and 21 (ftp). In the case of the Norton Internet Security screenshot
shown below, select ‘Permit’ and ‘Always use this action’ to prevent the message
appearing again in the future.
If you do not correctly configure firewall/security access settings, the Programming
Editor software will be unable to communicate with the PNS.

6
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Step 5 – View the PNS webpages using a browser
Open your normal web browser (e.g. FireFox or Internet Explorer) and enter the IP
address shown on the PNSscreen as the website address e.g.
http://192.168.0.10/
You should then see the home page of the default web site on screen. Click on the
hyperlink to ‘index2.htm’ and you will then see the status page of the PNS. Try
pressing the mode switch down – you should see the value for input 7 change from
1 to 0 as the switch is pressed/released (the web page is refreshed every 3 seconds so
the switch needs to be held down for a while).
Congratulations – you are now interacting with a real life device and seeing the on-screen
values change on a web page served by the PNS!

7
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
TT
TT
THEHE
HEHE
HE PP
PP
PICAXE NICAXE N
ICAXE NICAXE N
ICAXE N
ETET
ETET
ET SS
SS
S
ERER
ERER
ER
VERVER
VERVER
VER
Fitnessof Purpose
A microcontroller controlled server, such as the PNS, is primarily designed for a
single hardware application, for which remote control is required by a single
person/company.
A single process microcontroller, operating at 20MHz and reading data from an
EEPROM memory, obviously cannot act as a standard ‘web server’ serving
thousands of documents to hundreds of users! However, when used appropriately,
the PNSis an extremely versatile piece of equipment.
The PNSshould not be considered secure. As with all microcontroller based web
servers, it is susceptible to Denial of Service attacks (e.g. thousands of requests
flooding the device). To prevent this issue installation behind a firewall is strongly
recommended.
On occasions, when serving multiple requests, the PNSmay not be able to serve
your browser within the browser timeout period and so the browser may ‘time out’
with a ‘page not available’ error message. In these cases simply clicking the ‘refresh’
button on your browser will normally resolve the issue.
PNSPower Supply
The PNSis designed to operate from a 9V DC power supply, 2.1mm tip positive
connector. A suitable (UKonly) part is PWR009.
An on-board 5V regulator (type 7805) regulates the 9V supply to 5V for the PNS
electronic circuits. All interfacing to the PNS input/output pins should be at 5V
logic level. The input/output pins can source 20mA.
The PNS regulator does not normally require a heatsink for most PICAXEprojects.
However if your connected circuit draws a very large current it may be necessary to
add a heatsink to prevent overheating.
Operating current is variable upon a number of factors, including the input/output
port configuration and whether the connected PICAXEcircuit has a separate supply.
For minimal current drain set the port configuration as all inputs and disable the
two PNSLED towers (by removing jumpers J3 and J4).

8
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
PNSConnector Summary
Power RS232 10-BaseT
LEDs Reset
Mode
CONN5
(16 pin IDC)
ICD
Power Connector
2.1mm tip positive connector for 9V regulated DC supply.
RS232
Serial connection to PC. Uses 9M-9Fstraight wired cable (part CAB010). If your
computer does not have a 9 pin serial port you will also require the USB010 USB
adapter.
10-BASET
Network connector. Uses standard CAT5 network cable.
ICD
PIC ICD programming connector for firmware programming, not used with
PICAXEoperation
CONN5
16 pin IDC connector to connect to AXE022 protoboard (or other i/o board).
CONN6
Access to the i2c bus for testing or connection of the SPE030 speech synthesizer.
H1 and H2
Two alternate positions for connecting the 16x2 LCD. H1 is pre-fitted with a header
socket so that the LCD can be mounted directly on the PNS. H2 is provided so that
the user can remotely locate the LCD (connected via ribbon cable) if desired. The
PNSsupports both 16x2 and 20x2 displays.
J6
An optional connection point to allow connection of an off-board reset (push to
make) switch.
Please note that positions C21, C22 and J6 on the PICAXE Net Server are optional unused
component positions. It is normal for these positions to be unpopulated.
CONN6
(i2c)

9
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
LEDand Jumpers
LEDs
There are 4 LEDs (2x2 LED towers) located between the network and serial
connectors.
The LED tower next to the network connector indicates network activity. The top
LED indicates a network connection. The bottom LED indicates network activity.
This LED tower can be disabled by removing jumper 3
The top LED of the tower next to the serial connector is the 1Hz clock signal from
the DS1307 RTC (if enabled, via the RTC ‘control’ register). It is mainly used as a
power-on indicator (although it also demonstrates that the DS1307 RTC is correctly
configured and operating). The bottom LED next to the serial connector is the PNS
‘tick’ indicator (special function of pin4). When enabled, this pulsing ‘heart-beat’
signal indicates that the PNSis operating correctly. This tower LED can be disabled
by removing jumper 4.
Jumpers.
Jumper 1 enables the 100k pull up resistor on pin7 (mode switch).
Jumper 2 connects the on-board LED to pin4.
Jumper 3 disables the network LEDs.
Jumper 4 displays the output LEDs (top LED is RTC, bottom LED is pin4)
Jumper 5 connects the RTC backup cell. The cell has an approximate life of 10 years.
Do not confuse the jumpers on the PNS with the jumpers on the AXE022 project board!
J6 is a connection for an (optional) external reset switch. Do not apply a jumper in
this position – it would hold the PNSin a constant reset state!

10
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
CC
CC
CONFIGURAONFIGURA
ONFIGURAONFIGURA
ONFIGURA
TIONTION
TIONTION
TION
Configuration
The power-up default configuration of the PNS is carried out via a
wizard in the Programming Editor software. The wizard
downloads the default power-up settings to the PNS via the serial
cable. For security reasons it is not possible to update these
default settings via a network connection.
To configure the PNS:
1) Connect the serial cable from the PNSto your computer.
2) Connect the 9V DC power supply to the PNS.
3) Click the PICAXE>Wizards>PICAXENet Server>Setup menu
within the Programming Editor software
4) Edit the on-screen options as desired.
5) Click ‘Download’ menu and follow the on-screen instructions.
You may also save and open configuration files for later use.
Configuration – IPAddress
The IP address, subnet mask and default gateway can be entered for a fixed IP
address, or DHCP for a dynamic IP address may be selected. The default settings
are:
IP: 192.168.0.10
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.10
Configuration - Login and Passwords
All passwords and logins must be exactly 8 characters long. They can use any letter
or number character and are case sensitive (ie ‘A’ and ‘a’ are regarded as different).
New website images are downloaded by FTP. Therefore a Website FTP login and
password are required. The default setting is
Login: website1
Password: website1
New PICAXEprograms are also downloaded (via the PNS) by FTP. Therefore a
PICAXEFTP login and password are required. The default setting is (note upper case
letters):
Login: PICAXE12
Password: PICAXE12
Because it may not be desirable for anybody viewing the web page to be able to
alter the configuration (e.g. input/output pin configuration) of the PNSan access
password can also be enabled. When this access password system is enabled, the
user will only be able to update settings via web pages after the password has been
entered. The default setting is:
Access password status: disabled
Password: access12

11
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Configuration - Default Input/Output/SFsettings.
The default input/output port settings (and associated features such as PWM duty
cycle) can also be entered. See the Input/Output Port section for more details about
each configuration.
Configuration – Time/Date
The first time a PNSis used it may be necessary to download the current time and
date to the unit. Time is maintained by the on-board battery when the main power
is disconnected.
Configuration - Serial Number
Every device connected to the internet must have a completely unique serial
number, commonly known as the MAC address. When you purchase a PNSyou will
be allocated a unique serial number (which, together with a prefix number
allocated to the PNS product, form the unique MAC address). This unique MAC
address has been purchased on your behalf from the IEEE. The purchase price of the
PNSincludes the purchase of a single MAC address for that PNS.
YOU MAY LEGALLY ONLY USE THESERIAL NUMBER PROVIDED.
The serial number is printed on a label on the underside of your PNSand will be
similar in format to ‘28670’ (obviously each unit has a unique number). It is
extremely important that you only use this unique serial number. Under normal
situations it is not necessary to ever change the serial number.

12
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Advanced Manual Configuration
Most users will configure the PNS via the Wizard in the Programming Editor
software. However, as an alternate method, it is also possible to manually alter the
configuration via computers without the Programming Editor software installed.
To enter the advanced configuration setup mode, connect the RS232 cable to the
PNSand your computers serial port and then run any Terminal Application (e.g.
Hyperterminal) with a baud setting of 4800,n,8,1, no handshaking.
Then hold down the PNSmode switch whilst pressing reset. The LCD screen should
display ‘Setup…’ and a prompt message will appear in the Terminal window. The
following keyboard keys can then be used to change the default power-up settings:
Key Function
a Edit Serial Number
b Edit IP address
c Edit Gateway
d Edit Subnet mask
e Enable DHCP
f Disable DHCP
g Enable access password
h Disable access password
i Edit access password
j Edit Website login
k Edit Website password
l Edit PICAXElogin
m Edit PICAXEpassword
n Set Time (see notes below)
o Set Date (see notes below)
p Set Port
q Set TRIS
r Set SF
s Set PWM Period
t Set PWM Duty
u Save & Quit
v Factory Reset (resets all settings to Factory State and then reset)
Enter the new settings followed by [Enter]
When your changes are complete press u for ‘Save & Quit’
Note that if you use the Programming Editor ‘terminal’ feature you must press the
[Enter] key after typing the new setting data before clicking the ‘Send’ button.

13
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Advanced manual configuration notes- Setting the PNStime:
The time can be set manually by the RS232 link. Unusually, the DS1307 real time
clock (RTC) works internally with binary coded decimal (BCD) values, but the time
must be setup with a normal decimal value. Therefore it is necessary to perform a
BCD to decimal conversion before entering the data (note the setup wizard does
this automatically).
For instance, if the time (24 hour format hh.mm) is currently “13.21”
The decimal value to enter is 19.33
as 13 = 1 x 16 + 3 = 19
and 21 = 2 x 16 + 1 = 33
The time must be input using a dot (.) separator, not any other character.
Advanced manual configuration notes- Setting the PNSdate:
The date can be set manually by the RS232 link. Note that the DS1307 works
internally with BCD values, but the date must be setup with a normal decimal
value. Therefore it is necessary to perform a BCD to decimal conversion before
entering the data (note the setup wizard does this automatically).
For instance, if the date (UK dd.mm.yy format) is currently “25.12.05”
The decimal value to enter is 37.18.05
as 25 = 2 x 16 + 5 = 37
and 12 = 1 x 16 + 2 = 18
and 05 = 0 x 16 + 5 = 05
The date must be input using a dot (.) separator, not any other character such as
slash.
After the date has been set the 1Hz clock pulse LED (top LED next to RS232
connector) should start flashing.

14
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
II
II
INTERFNTERF
NTERFNTERF
NTERFAA
AA
A
CINGCING
CINGCING
CING
AA
AA
A
PP
PP
PICAXEICAXE
ICAXEICAXE
ICAXE CHIPCHIP
CHIPCHIP
CHIP
TT
TT
TOO
OO
O
THETHE
THETHE
THE PP
PP
PICAXE NICAXE N
ICAXE NICAXE N
ICAXE N
ETET
ETET
ET SS
SS
S
ERER
ERER
ER
VERVER
VERVER
VER (PNS)(PNS)
(PNS)(PNS)
(PNS)
There are two ways to interface a PICAXEchip to the PNS.
Simple Systems
For simple systems it may be sufficient to simply connect a PICAXEoutput
pin to a PNSinput pin. The state of the PICAXEsystem is therefore simply
detected by reading the PNS input. This is a very simple method of
interfacing - the PNS has up to 8 inputs available. Similarly a PNSoutput can
be connected to a PICAXEinput. This system will work with any size or type
of PICAXEchip.
It is recommended that the PICAXEto PNS connections are made via a
330ohm resistor. This provides a safety mechanism if both PICAXEand PNS
are accidentally configured as outputs during testing. Remember it is also
necessary to link the ground (0V) on both systems to provide a common
reference. The PNS operates at 5V logic levels.
Complex Systems
For more complex systems it may be necessary to share data between the
PICAXEand PNS. This is achieved by use of the shared memory space, which
is read and written by use of the i2c bus. On the PICAXEchip this involves
using the i2cread and i2cwrite commands. This system is primarily designed
to operate with a PICAXE-28X or 40X microcontroller.
The shared memory space is located on a DS1307 real-time-clock (RTC) chip
on the PNS. In total there are 64 (numbered 00 to 63) shared byte registers,
although some of these are reserved for special functions (explained later).
These registers are RAM based, but are backed up by a battery and so the
values are not lost on power down (as long as the on-board PNSbackup
battery is connected via jumper 5).
With this shared memory system the i2c bus is shared by both the PNSand the
PICAXEchip. Under normal operation the PNSis the ‘master’ and controls use of
the i2c bus. The PICAXEchip must ‘ask permission’ from the PNS to use the i2c
bus, and may only use the i2c bus when this permission has been granted.
There are 4 connections between the PICAXEchip and the PNS. The following table
relates to a PICAXE-28X chip.
PICAXEoutput 0 RTS - set high to request permission from PNS
PICAXEinput 5 CTS - when set high by PNS, PICAXEchip may use i2c bus
PICAXEinput 4 SDA - i2c data
PICAXEinput 3 SCL - i2c clock
The PICAXE-28X/40X protoboard (part AXE022) is designed with these
connections already made for ease of experimentation.
0V
PICAXE PNS
Shared
Memory
RTS
CTS
i2c
0V
PICAXE
0
PNS

15
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Using the AXE022 Proto board
Before connecting the AXE022 project board to the PNS
(via the 16 way ribbon cable supplied) ensure that the
AXE022 jumpers are correctly configured:
1) Jumper 1 is to the left.
2) Jumper 2 is to the left.
3) Jumper 3 is to the left (separate power supply)
or to the right (use 5V supply from PNS).
4) The EEPROM socket is empty*
Also make sure the program currently in the PICAXEchip
is compatible with the PNS(particularly the operation of
output 0 (RTS)). If in doubt download an ‘empty’ program into the PICAXEchip
prior to connection. See the shared memory section for more details.
*If desired, it is possible to use a PCF8570P RAM chip in the EEPROM socket. See the
‘extending the shared memory’ section for more details.
AXE022 Connector
The pinout of the 16 pin IDC connector used on the AXE022 (and NET006 demo
board) is as follows. If designing your own project board to use with the PNS you
should follow the same connector layout (16 pin IDC connector, part CON014).
The input/output numbers shown correspond to a
PICAXE-28X chip.
The bottom 8 pins on the connector are the PNS
input/output pins (P0-P7).
The serial TX and RX connections are only made when
jumpers J1 and J2 on the AXE022 are in the right hand
position. When the jumpers are in the left position the
PICAXEchip is connected to the standard PICAXE3.5mm
download socket on the AXE022 board.
The 5V connection is only made to the PNSwhen AXE022 jumper J3 is in the right
hand position. When in the left hand position power for the AXE022 must be
supplied via the 2 pole terminal block.
See the equivalent circuit diagram on the next page for more details.
Errata – please note that on early AXE022 ‘101190 v2’ boards the optional regulator RG1
is marked the wrong way around ( correct configuration is flat side next to the PICAXe
chip). This is corrected on v3 and later boards. This is not normally relevant to PNS users
as they will not generally be using this regulator anyway.
SDA (input 4)
RTS (output 0)
CTS (input 5)
RX (serial in)
P0
P1
P2
P
(input ) SCL
5V
0V
(serial out) TX
P7
P6
P5
P4

16
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
AXE022 to PNSEquivalent Circuit Diagram
Notes:
This diagram above shows a simplified equivalent i2c
/ serial circuit inside the PNS. The diagram to the right
shows the AXE022 project board connections that are
made to the PNS via the ribbon cable.
The PICAXEchip can be powered via an external
supply or from the PNS 5V supply (using jumper J3
on the AXE022).
The PICAXEdownload pins can be connected to the
stereo socket on the AXE022 board or to the PNS
serial pins (using jumpers J1 and J2). Do not connect
the RS232 cable to the PNSat the same time as the
PICAXEchip is connected via jumpers J1 and J2 on
the AXE022 board.
The optional PCF8570P (part MIC052) is not
included in the starter pack. If required, it is placed in
the 8 pin socket on the AXE022 project board.
PCF8570P
0V
A0
A1
A2
GND
Vcc
WP
SCL
SDA
V+
0V
PICAXE-28X
IN
RAM
(optional)
IN4
IN5
OUT0
TX
RX
To PNS via
Ribbon cable
10k
22k
J2
J1
J
CT1
Serial
CT2
Power
180
5V
0V
CTS
SDA
SCL
RTS
TX
RX
DS1 07
5V
0V
X1
X2
Vbat
GND
2.768kHz
watch crystal
V
Lithium
4k7
Vcc
SQW
SCL
SDA
V+
0V
PNS
24LC512
A0
A1
A2
GND
Vcc
WP
SCL
SDA
4k7
SPE0 0
Vcc
SCL
SDA
GND
SCL
RTC EEPROM
SPEECH
(optional)
PNS - Internal i2c bus circuit details
1k
2x 1k
J5
J4
SDA
CTS
RTS
2x
100k
to
CONN5
2x 1k

17
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Release of i2cbusfor PICAXEuse (PICAXE-28Xexample)
The sequence for the PICAXEchip requesting permission to use the i2c bus is as
follows:
The PICAXEchip
- sets RTS (output 0) high
- waits for CTS (input 5) to go high
When next idle, the PNS
- updates bytes 08-15 with current input values
- releases i2c port
- sets the CTS signal high
- waits for the RTS (PICAXEoutput 0) to go low
The PICAXEchip can then
- uses the i2c bus to read/write data
- set RTS (output 0) low
The PNS then
- clears the CTS signal
- reads bytes 16-23 and updates as necessary
- resumes normal operation
.
A sample PICAXEprogram that will update the PNSwith the value of three PICAXE
variables is shown below. In this example the variables b0, b1 and b2 are updated
every 5 seconds, and then this data is transferred to the PNS (shared memory bytes
50-52).
init: i2cslave %11010000, i2cslow, i2cbyte ; setup i2c DS1307
main: let b0 = b0 + 1 ; increment variables for demo
let b1 = b1 + 2
let b2 = b2 + 3
pause 5000 ; wait 5 seconds
gosub PNS_write ; update the PNS
goto main ; loop forever
PNS_write: high 0 ; set RTS
CTS_loop: if pin5 = 0 then CTS_loop ; wait for CTS
writei2c 50,(b0,b1,b2) ; write to PNS bytes 50-52
low 0 ; clear RTS
return
Note that the PNS ceases web serving operations when the PICAXEhas control of
the i2c bus, and so aannot serve web pages at this time. Therefore the PICAXE
should release the bus as soon as possible. Likewise the PICAXEprogram should be
designed to only update the shared memory when necessary (ie it is better to
update after a variable has changed, not a regular timed loop every few seconds).
0V
PICAXE PNS
Shared
Memory
RTS
CTS
i2c

18
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
PICAXENETServer - i2cbuscircuit diagram
This diagram shows the internal configuration of the components connected to the
i2c bus within the PNS.
The DS1307 RTC contains the shared memory space. The 24LC512 EEPROM
contains the website image and configuration details and must therefore not be
accessed via the PICAXEchip. Writing to the EEPROM by the PICAXEchip will
corrupt operation of the PNS.
The optional SPE030 speech synthesier is available separately. It is connected to the
i2c bus by soldering a 5 pin connector (part CON043) in position CONN6 on the
PNS.
DS1 07
5V
0V
X1
X2
Vbat
GND
2.768kHz
watch crystal
V
Lithium
4k7
Vcc
SQW
SCL
SDA
V+
0V
PNS
24LC512
A0
A1
A2
GND
Vcc
WP
SCL
SDA
4k7
SPE0 0
Vcc
SCL
SDA
GND
SCL
RTC EEPROM
SPEECH
(optional)
PNS - Internal i2c bus circuit details
1k
2x 1k
J5
J4
SDA
CTS
RTS
2x
100k
to
CONN5
2x 1k

19
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
PICAXEProgram Download via PNS
It is possible to reprogram a connected PICAXEchip via the PNS. For this to occur
the serial output of the PNSmust be connected to the serial programming pins of
the PICAXEchip. With the AXE022 project board this is achieved by moving
jumpers 1 and 2 both to the right position (position nearest to the J1 and J2 text).
WARNING - Never connect the RS232 cable to the PNS at the same time that the
jumpers are in the right hand position. It is strongly suggested that masking tape or similar
is placed over the 9 way socket on the PNSto prevent accidental dual connection.
Only PICAXE-28X, 28X2, 40X and 40X2 chips can be programmed via the PNS. No
other PICAXEchips are supported. The download process will timeout after ten
seconds if no PICAXEchip is detected.
Downloading is a two stage process. First the new program is
compiled by the Programming Editor software and then sent as a
file (by FTP) to the PNS. This is carried out via the
PICAXE>Wizards>PICAXENet Server>PICAXEdownload menu.
Once the FTP download is complete, the PNS can be issued (at any
time) with a ‘PICAXEprogram’ command (command 26). This will
attempt to program the attached PICAXEchip with the new
program. Note that this command requires the correct PICAXE
password (default is PICAXE12) as it’s value, otherwise it is ignored.
This can be achieved manually via a web page form, or by clicking
the ‘Program PICAXE’ button that will appear after a successful FTP
transfer.
The ‘PICAXEprogrammed’ display variable (?82) indicates whether
the last programming attempt was successful.
Notes:
• The download process requires the whole PNS processing time. Therefore it is
likely that your web browser will ‘time-out’ during the download. Simply click
‘refresh’ 20 seconds after the process was started.
• If enabled, the ‘tick’ LED will go out when the PNSis searching for a PICAXE
chip, and then light solid when the programming is taking place.
• Take extreme care that a downloaded PICAXEprogram is compatible with the
PNSsystem. Take particular care with the state of output 0 (which is the RTS
signal to the PNSfor shared memory use). A downloaded program that
incorrectly sets this pin permanently high will ‘lock-up’ the whole system! In
this case it is necessary to remove the PICAXEchip from the system and re-
program it conventionally elsewhere.

20
revolution Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk Version 2.1 14/04/06
PICAXE is a licensed registered trademark. ‘PICAXE Net Server’ and ‘PNS’ are trademarks. NET001.PMD
PICAXENETSERVER
Shared Memory - Byte Allocation
There are 64 bytes (00-63) of shared memory between the PNS and the PICAXE
chip. All addresses can be read by either device, however only some should be
directly written.
Read only by PICAXEor Web Page
00 RTC Seconds
01 RTC Minutes
02 RTC Hours
03 RTC (not used)
04 RTC Day
05 RTC Month
06 RTC Year
07 RTC Control
Read only by PICAXEor Web Page
08 Input Port value
09 ADC0 value
10 ADC1 value
11 ADC2 value
12 ADC3 value
13 ADC value (LS Bits) (least sig. 2 bits of ADC0-3)
14 Temp. value (whole deg.) (bit 7 indicates negative number)
15 Temp. value (2dp) (2 decimal places 00-99)
Read or write by PICAXE.
Read only by Web Page (use separate CGI commands to write)
16 Output Port value
17 TRIS value
18 SFvalue
19 PWM Period
20 PWM Duty (low)
21 PWM Duty (high)
22 LCD Copy Command (will always read 0 by web page)
23 (reserved for future use)
Read or write by PICAXEor Web Page (26 registers)
24-49 General Purpose User Register
Read or write by PICAXE(14 registers)
Read only by Web Page
50-63 General Purpose User Register
Other R/Evolution Server manuals
Popular Server manuals by other brands

Sun Microsystems
Sun Microsystems Netra st D130 Installation and maintenance manual

Solarflare
Solarflare Solarflare XtremeScale series user guide

Lenovo
Lenovo 7D7M Reference

NEC
NEC Express5800/GT110d user guide

Lenovo
Lenovo ThinkServer TD200x warranty and support information

Supero
Supero SUPERSERVER 6027TR-HTRF+ user manual