Organiser II 1-Wire code for Top Slot Retro I/O interface or compatible 5 volt interface to Top Slot (e.g. internal COMMS adaptor signals).
1-Wire is ideally suited to the Organiser II device as it is a low power half duplex system, designed to support a large number of low power devices. Devices, e.g. Temperature sensors, clocks, authenticators, memory, a/d convertors etc. on a 1-Wire network are connected in parallel and can be addressed simultaneously or individually depending on the applicable mode.
This Psion Organiser II OPL program uses the Top Slot Retro IO Basic interface (or compatible COMMS, 5 volt signals) to access 1-Wire devices. Examples demonstrate accessing a 1-Wire DS18B20 temperature sensor, though any 1-Wire device can be accessed via the interface and supporting protocol.
The Organiser II is also able to emulate a 1-Wire device via additional software.
For a full list of 1-Wire capable devices, see the manufacturers site.
Devices such as the ATTiny85, PIC family, CH32V003 or other microcontrollers can be configured with software to act as 1-Wire devices for additional sensors (Seperate power may be required).
DS18B20.OPL is demonstration code that uses the features made available by the basic supporting procedures. In order of typical use they are:
Routine | Parameter | Returns | Comment |
---|---|---|---|
PON: | None | None | Power on the Top Slot Retro IO Basic |
IOB1WSET: | None | None | Set Top Slot Retro IO Basic interface to correct state for subsequent 1-Wire transactions |
ONEWRST: | None | Byte | Reset the 1-Wire Micro Lan and return the detected status |
SND1WBYT: | Byte | None | Send a single byte e.g. a ROM command |
RD1WSPD$: | String | String | Reads a device scratch pad |
ONEWCRC: | String | Float | Calculate CRC of data in String |
POF: | None | None | Turns off the Top Slot |
The demo code DS18B20 is intended to be simple rather than efficient in its use of resource e.g. memory or processing. The machine code routines are for example re-built on every call, adding considerably to overhead in the demo routine. Pre-building the machine code would speed the data acquisition which would reduce power consumption. DS18B20x: (to be released) implements such a scheme minimising Top Slot on period.
Connection to the Top Slot Retro IO Basic requires a diode and resistor. A diode is connected between pin 3 ( D3 ){Andode} and pin 6 ( D4 ) {Cathode}. A 4k7 resistor is connected between Pin 3 ( D3 ) and Pin 5 ( D0). Pin 4 ( D2 ) is not used and should be pulled low to ground.
Pin | Function | Circuit & Comment | 1-Wire Function |
---|---|---|---|
1 | +5 V | No connection (+5 Volt Orgnaiser internal power) | |
2 | 0 V | 0 V | 0 Volt ground reference |
3 | D3 | Diode Anode & Pull Up resistor | 1-Wire Data Line |
4 | D2 | Connect to ground refernce | |
5 | D0 | +5 Volt 30 mA 1-Wire power (for non parasitic devices) & Pull up resistor | Vdd (Power) |
6 | D4 | Diode Cathode, 1-Wire current sink for DQ, connect to 1-Wire DQ via Diode Anode |
A standard 1-Wire device (such as th DS18B20) is connected:
Pin | TSRIOB Pin | 1-Wire Function |
---|---|---|
1 | Pin 2 - 0 V | Ground reference |
2 | Pin 3 - D3 | DQ line |
3 | Pin 5 - D0 | Vdd (+ 5 volt power) |
1-wire signals are typically 0 to 5 volt (3 Volt devices are becoming available) having signals as shown below:
The Controller (in this case the Organiser II) signals are shown in yellow / gold. The target device signals e.g. a DS18B20 temperature sensor, i-button etc. are shown in dark green. It Will be seen from the signal traces that the controller initiates all transaction over the 1-Wire network.
Periods (in uS) are (approximate):
Label | Period |
---|---|
A | 15 |
B | 45 |
C | 60 |
D | 5 |
E | 15 |
F | 40 |
G | 5 |
H | 480 |
I | 15 |
J | 15 |
The files must be run from the A: or D: drive during the period over which the Top Slot is active.
Only the OPL files are required along with the interface, the assembly files are not required.
Copy the OPL files to the A: drive and run DS18B20 when a 1-Wire temperature sensor is connected as described above.
The ROM Search utility has not been implemented at this time, there are two options:
- For multi device networs, address devices directly using a devices known address via the MATCH ROM command
- Use only a single device
The current iteration supports 1-Wire standard mode only.
Where no Top Slot ROM is used for the 1-Wire code base, code accessing the Top Slot must reside on the internal A: storage location. As power and data for the 1-Wire network is sourced from the Top-Slot and uses the internal data bus, a 1-Wire transaction sequence must complete before accessing B: or C: storage locations. i.e. Calling POF:, or equivalent to terminate Top Slot use.
External interfaces using power are limited to 30 mA maximum and should consider the power drain on Organiser II devices limited battery power.
See Organiser 2 Hardware forum, though see note below first.
All information is For Indication only. No association, affiliation, recommendation, suitability, fitness for purpose should be assumed or is implied. Registered trademarks are owned by their respective registrants.