Manual OC32/NG
VPEB
Control your Miniature World
Page 6 of 48
Version 1.0 – December 15
th
, 2017
2017 Leon van Perlo
(This page is intentionally left blank)
Control your Miniature World
VPEB
Manual OC32/NG
2017 Leon van Perlo
Version 1.0 – December 15
th
, 2017
Page 43 of 48
7
Serial Accessory Port
Starting from firmware 3.0.0.0, the OC32 offers a Serial Accessory Port. This feature
enables control of external Devices without using I/O Pins. A typical example of such an
external Device could be a sound module.
If the sound module has just a single function (sound on or off, e.g. the bell of a railroad
crossing) it is questionable whether serial control makes much sense. Probably in this case
it is easier to use an OC32 I/O Pin to switch sound on or off. A different case is using a
sound module that can play multiple sound fragments, such as background sound, depending
on the time of the day and maybe specific circumstances, or playing announcements in
station about arrivals and departures of trains. In these cases you want more control
options and controlling a Device by serial command may be an interesting option.
Of course a sound module is just an example. In principle you can control all kind of Devices
that have a serial input for control. The requirement is that the protocol is extremely
simple, just a few characters for a control command, and control is unidirectional. The OC32
can send command to the external Device, but the external Device cannot send anything
back. If you are handy with microcontrollers, you could develop your own control module for
‘something’, e.g. based on a Microchip or Atmel microcontroller, and control this serially
from the OC32.
The SAP shares the serial hardware (UART) with the RS232 interface on the OC32. The
consequence is that, when using the SAP, the normal RS232 port can no longer be relied
on. The SAP therefore can only be used when you control your OC32 operationally by
RS485, DCC or of the module functions autonomously.
The SAP has a TTL level interface (0-5V). Many microcontrollers feature a built-in serial port
working on a 0-5V level and can be interfaced directly. If you need RS232 or RS485 levels,
you’ll need to add a signal converter after the SAP.
The SAP can be found on the 6-pin connector, next to the diagnostic
LEDs. The same connector also offers 0V/GND and 5V connections. You
can use this 5V to power a signal convertor, or even your external
controller, if it does not consumes to much power. Be aware that the
current to this port is negated by the on-board 7805 at the OC32. How
much additional current can be drawn safely depends on e.g. how many
outputs you already drive by resistor arrays and what unstabilised Voltage
you apply to your OC32.
K
6
+5V
GND
TxD
K
6
+5V
GND
TxD
Fig 41: Pinout SAP