Starpoint Sec - Technical-Info
Starpoint Sec - Technical-Info
OPERATING PROCEDURE
Ref: SOP-0200-03-N-DEV
SEC
Description:
Starpoint Technical Information
Tel: +44 (0)208 391 7700 or Fax: +44 (0)208 391 7760
Contact: - [email protected]
DISCLAIMER
1. Starpoint Electrics Limited ("Starpoint") has taken all reasonable care in preparing this technical
information pack ("Information Pack") and has used all reasonable efforts to ensure the accuracy of the
information contained in the Information Pack. However, the information contained in this Information
Pack may be subject to change from time to time, and Starpoint shall have no liability whatsoever to any
person arising out of or in connection with reliance on any information contained in this Information
Pack.
2. Starpoint reserves the right at any time to amend or update the information contained in the Information
Pack, or to withdraw the Information Pack in its entirety and/or to withdraw and/or replace the products
referred to in the Information Pack, and Starpoint shall not be obliged to notify any person of any such
changes. Before taking or implementing any action based on the information contained in the
Information Pack, you must contact Starpoint at the address given above in order to ensure that the
Information Pack is up-to-date.
3. The Information Pack contains confidential information of Starpoint, and you must not disclose the
Information Pack (in whole or in part) to any person, without our prior written consent.
4. The products may vary slightly from their description in the Information Pack, and Starpoint accepts no
liability for such variances.
Conditions of Use
1. Temperature Range
2. Humidity
3. Operational Life
4. Handling
5. Warranty
Hardware Overview
1. Construction
2. Communications Interface
3. Interface Connector
4. LCD Display
5. Reset Line
6. Data Storage
7. Hardware Specification
Software Overview
1. Host Interface Operation
2. Command Format from Host
3. Command Response from SEC
4. LCD Display Interface
5. Software Watchdog Facility
Functionality
1. Power Up Sequence (SEC)
2. Power Up Sequence (Host)
3. Commands
a. <20> Request Status
b. <21> Request Market Type
c. <22> Request Last Error
d. <23> Request Version
e. <24> Reset Counter Value
f. <25> Request Last Command ID
g. <26> Request Fingerprint
h. <30> Set Number of Counters
i. <31> Set Market Type
j. <32> Set Counter Type
k. <40> Show Text
l. <41> Show Counter Value
m. <42> Show Counter Text
n. <43> Show Bit Pattern
o. <50> Counter Increment (Small)
p. <51> Counter Increment (Medium)
q. <52> Counter Increment (Large)
r. <54> Cycle Counter Display
s. <55> Stop Cycle
t. <5C> Self Test
Security
1. Communications
2. Fingerprint
The SEC is based around the Toshiba TMP87P808M 8 bit controller. The device
has 4 Kbytes of Program ROM and 256 bytes of user RAM. The device is connected
to a custom 7-digit LCD display (via a LCD driver device), an 8K bit serial EEprom
and a serial link.
The text can be changed by the host machine, enabling the counter unit to be
configured for different languages or different counter uses as it is moved from the
host machine to another.
The counters are managed under host control via a clocked serial link. The host can
use as many of the 31 counter as is required, the counter cannot be cleared to zero
or decremented under normal circumstances. The lifetime of the unit is specified as
a minimum of 9,999,999 single increments on any one counter.
During normal operation, the SEC will display the contents of the counter 0 (default)
on the LCD display. The host can also control the LCD display directly, enabling text
and counters to be shown in any user-defined order, or to show text messages from
the host machine.
The SEC will operate satisfactorily in the temperature range 5ºC to 50ºC
provided there is an unrestricted airflow around the unit.
Humidity
2. Humidity
Operational
3. Operational Life
Life
Handling
4. Handling
It is not recommended to install or remove the SEC unit whilst the host
machine is powered up, as this may lead to internal damage.
Warranty
5. Wrranty
A guarantee of twelve months from the shipment date is available for the SEC,
subject to Starpoint’s standard terms and conditions. This guarantee is offered
irrespective of the number of operations of the unit during this period but subject
to operation within the environmental conditions specified above. A unit, which
may require return under the guarantee, should be returned direct to Starpoint or
your local distributor.
Construction
1. Construction
CommunicationsInterface
2. Communications Interface
The clocked serial interface conforms to the Motorola SPI (Serial Peripheral
Interface) standard. The SPI standard details 4 modes of operation, dependant
on the clock polarity and phase, the SEC unit uses SPI mode 2. In this mode,
the clock line (SCLOCK) idle state is HIGH (logic 1). To transmit, data is set up
on the SIN line, the clock is taken low and then it is taken high again. The next
data bit is set up on the SIN line, the clock taken low then high and so the
transmission continues. (The data is clocked in, on falling edge, MSB is
transmitted first). Once transmission is complete and the SEC has executed the
command, the response can be clocked out. First the clock is taken low and
then taken high again. The received data is sampled as the clock edge rises.
This is repeated for all the data bits. Maximum clock speed at 50% duty ratio is
5KHz. Slowest clock speed is 100Hz. See Appendix 2 for timing diagram.
InterfaceConnector
3. Interface Connector
LCDDisplay
4. LCD Display
The LCD display is a custom device with limited Alpha characters, which is
contained in Table 2.
Reset
5. Reset Line
Line
A reset line is provided that forces a hardware reset of the TMP87P808M device.
The reset should be asserted after power has been applied and unit power is
stable to ensure a good reset, after which it should only be asserted if the
operation of the SEC has become suspect and several retries on the
communications link have failed, or instances of sparking may be suspected.
Operation of the reset line will not affect the counter values but will cause a
clearance of the pending and current communications buffers.
Counter data is stored in the EEprom in the 24 bit binary format followed by an
8-bit checksum, making a total of 4 bytes. This data is then followed by a 2’s
complement copy of the same information and another checksum. Should data
become corrupt, the SEC will use the two checksums to determine which of the
copies is in error. The good copy will then be used to correct the error in the
faulty copy.
Should any read from EEprom fail (due to fraud attempt, checksum failure etc.)
the read is attempted a further 10 times before the SEC assumes the data really
is corrupt. This way, spurious errors during read cycles are reduced. The same
procedure is used during a write cycle - the location is read after the write has
been performed and if the read is incorrect the location is written again until it
reads correctly.
HardwareSpecification
7. Hardware Specification
Data Output
Maximum Output Current 100mA
Maximum Output Voltage 60v
HostInterface
1. Host InterfaceOperation
Operation
Incoming characters from the data-in line are placed in a buffer, and then when
the buffer is full the command is decoded and, if valid, executed. Outgoing
messages are placed in the output buffer and then sent via the data-out line.
Note that full duplex (simultaneous transmit/receive) is not possible and will
result in data loss, so the host should ensure this does not occur. The Host
Interface will clear the input buffers if an incoming transmission are not
completed within 1 second.
CommandFormat
2. Command FormatFrom
FromHost
Host
Commands sent to the SEC consist of a variable length data packet consisting of
data bytes: a command, a message ID, a data count, data (if applicable), and a
checksum.
The SEC replies to the Command messages in a similar format except the CMD
byte will be either on ACK (61) or a DATA header (60). Receipt of these
responses signifies the command has been received correctly and the reply has
been sent. If a NAK (62) is received this would indicate some corruption of the
command message, the command and incremented ID should be resent.
The response by the SEC with a reply and ID serves to verify to the host the
current valid message the SEC is dealing with. This is particularly useful if the
host has sent a command prior to loss of power. By requesting the ID of the last
command the next time the machine powers up, the host can verify that the last
command has been dealt with correctly by the SEC, If data was requested at the
last command before loss of power and not received the host should resend the
command with a new ID and the SEC will reply.
If the host sends a repeat of a previous ID and the command was correctly
executed, the SEC will acknowledge the message but will NOT execute it.
LCDDisplay
4. LCD DisplayInterface
Interface
ASCII data is coded into 7-segment character and written to the display buffer.
The hardware then continuously displays the contents of the buffer on the LCD
display and requires no further software overhead. The ASCII characters the
SEC can display are shown in Table 2.
SoftwareWatchdog
5. Software WatchdogFacility
Facility
On the first power up at manufacture the counters are all set to zero and a non-
destructive flag set to prevent a clear on subsequent power ups. All counters in
the EEprom have a sum check associated with them for security.
PowerUp
2. Power UpSequence
Sequence(Host)
(Host)
Every time the host machine powers up and after initialization it should request
the fingerprint of the counter. If this is different from the previously recorded
fingerprint, the host should record the new fingerprint and that the counter has
been changed. The host should set the number of counters and the text for the
counters. The host should also check the ID of the last message that the SEC
received. This will indicate if a reset occurred during execution of a command
(e.g. increment counter). If this is the case, the host should take remedial action
as required, e.g. either retransmit the last message or assume that it was
completed successfully and take no further action.
Commands
3. Commands
The SEC will process one command at a time from the host system i.e.
increment counters, display counter etc. whilst processing a command any
receipt of a new command will receive a <NAK> and SEC Busy response. Once
a complete command is received, the SEC will process the command and then
send an appropriate response back to the host. If the command was completed
successfully and no data was requested, an <ACK> message is sent back to the
system. If the command requested any data, the data will be sent to the host,
followed by a checksum byte, details of the reply are contained in the sub-
section dealing with the individual command. If an error occurred when
processing the command, or the command was invalid, then a <NAK> message
is sent back to the host system. The data byte of this <NAK> message will
contain data that indicates the nature of the error and the host can take
appropriate action.
The specific commands that can be sent to the SEC are listed in this section.
For simplicity index numbers and check sums are shown as <ID> and <CS>
respectively and are unique to the message at transmission time. Data bytes
are shown as <D1> to <D8> as required in all cases <D1> is the MSB. The SEC
responses are the correct response for the given command; an error response
will be given if an error occurs in transmission or execution of the command.
Execution times shown indicate maximum delay between end of message sent
and start of message being received.
<21>Request
b. <21> RequestMarket
MarketType
Type
This command requests the Market Type form the SEC. Market types
maybe used to identify different counter and text combinations between
markets and may be used to value from 00 to FF (0 to 255 decimal). The
SEC stores the market type but does not make any use of the value – it
is only the host machine’s reference.
<D1> Market
01 UK AWP Token (Cash in/out, Token in/out, Token refill)
02 UK AWP All Cash, Club & SWP (Cash in/out, Cash refill)
03-FF Undefined
The last error code generated by the SEC will be transmitted to the host.
See section 4.5 - Error Codes for a detailed list of what the codes mean.
<D1> Description
00 No error
01 Transmission checksum corrupt
02 SEC busy
03 Invalid data in message
04 Invalid command
05 EEprom read/write failure
06 Fingerprint requested when not set
07 Firmware checksum failure
08 EEprom bus failure
09 Receive buffer overflow
<23>Request
d. <23> RequestVersion
Version
The host requests the current value of the counter specified by the byte
<D1> from the host, in the range 0 to 1E. The current value of the
specified counter is sent from the SEC to the host system in BCD format
in data bytes <D1><D2><D3><D4> as follows:
f. <25>Request
<25> RequestLast
LastCommand
CommandIDID
The SEC sends the ID code of the previous command it received and
executed from the host as data byte <D1>. This can be used by the host
to determine if messages were missed during a power down cycle, for
instance. Command ID codes should range from 00 to FF.
<26>Request
g. <26> RequestFingerprint
Fingerprint
The SEC sends its stored fingerprint to the host. The fingerprint consists
of a 32 bit (4 byte) binary code assigned to the SEC at manufacture. The
host machine should also check the fingerprint has been set correctly. If
the fingerprint has not been set, this command will return a <NAK> code
with an error code of 06 – Fingerprint not set. This error code will also be
returned if an attempt is made to increment the counters whilst the
fingerprint is not set.
Execution time 15 mS
This command sets the number of counters that will be shown using the
cycle counter command (code 54). The value <D1> can be set in the
range 1 to 1F. If a value is specified outside of the range, a <NAK>
message will be returned along with an error code 03 – Invalid data is
command. Note that setting this value does not restrict the number of
counter that the host can use in anyway.
i. <31>Set
<31> SetMarket
MarketType
Type
j. <32>Set
<32> SetCounter
CounterText
Text
The text for each counter can be set using this command - the text is
stored in EEprom and will remain until changed. This text is shown on
the LCD when the counters are displayed by the host using the show
counter text commend <42>. The byte <D1> specifies the index of the
counter text to set and may be in the range 0 to 1E. If a value is specified
outside this range, this command will return a <NAK> message along
with an error code 03 - Invalid data in command. The text string must be
7 ASCII characters long, the byte <D2> being the leftmost character on
the display and <D8> being the rightmost character. Should the text
become corrupted during SEC operation the SEC will set a bit 0 in it’s
status byte (see section 4.3.1) and the host machine should retransmit all
the text strings on the next power up cycle.
An ASCII text string is sent to the SEC, which is then displayed on the
LCD display, enabling the SEC to be used as a messaging device. Note
that the LCD display only has seven segments; the characters that can
be displayed are limited.
l. <41>Show
<41> ShowCounter
CounterValue
Value
The SEC will display the current value of the counter specified in <D1>
on the LCD display where <D1> is in the range 0 to 1E. If a value is
specified outside this range, this command will return a <NAK> message
with an error code 03- Invalid data in command.
<42>Show
m. <41> ShowCounter
CounterValue
Text
The SEC will display the current text string of the specified counter in
<D1> on the LCD display. Where <D1> is in the range 0 to 1E. If a value
is specified outside this range, this command will return a <NAK>
message with an error code 03- Invalid data in command.
<43>Show
n. <40> ShowText
Bit Pattern
The SEC will directly write the specified bit pattern in <D1> to <D7> to
the LCD display driver, enabling patterns and animation’s to be shown
on the display. The host sends one bit pattern as a byte for each display
position, <D1> being the leftmost character on the display and <D7>
being the rightmost character on the display.
<51>Request
p. <23> CounterVersion
Increment (Medium)
<52>Request
q. <23> CounterVersion
Increment (Large)
The SEC will display the text for counter 1 for 1 second, followed by the
value of counter 1 for 3 seconds. This will repeat 3 times, and then
counter 2 text will be displayed. This sequence will continue for the
number of counters specified by the host, using the ‘set number of
counters’ command. Finally, the display will return counter 0 text and
value and then stop cycling, leaving the counter 0 value on the display. If
the ‘set number of counters’ =1, then only the value of counter 0 is
displayed.
<55>Cycle
s. <54> Stop Counter
Cycle /display
The SEC will stop cycling through the counter values and show the value
of counter 0 on the display (default display). This command overrides
previous cycle commands and will stop the display cycling.
t. <5C>Cycle
<54> Self Test
Counter /display
The SEC will perform a limited self-test function and the results will be
returned to the host. If the self-test is successful, the SEC will return an
<ACK> message. If the test fails for any reason, the SEC returned a
NAK message, which includes an error code <D1> indicating the nature
of the failure. (See section 5 in Functionality `Error Codes’ for Details).
<CMD><ID><DCNT><D1><CS>
<60>Cycle
a. <54> Data Counter
Header /display
<61>Cycle
b. <54> Self-Test
Counter /display
Example: 61 27 00 88 ) Acknowledge a
) message <ID> no.
) 27.
) No data required
) and therefore not
) returned.
<62>Cycle
c. <54> NAK Counter /display
00 No
a. <54> Error
Cycle Counter /display
This is included for completeness. The last error will only be set to this
value after manufacture and before any errors have occurred. Once
errors have occurred, the last error value is never set back to no error.
01 Transmission
b. <54> Checksum
Cycle Counter /display Corrupt
The transmission from the host was corrupted in some way, e.g. the
transmitted checksum did not match the calculated checksum. The
command will not be executed and the host should retransmit.
02 SEC
c. <54> Busy
Cycle Counter /display
Either the last command is still being processed, or the data buffers are
currently in use by the SEC. The first case occurs when a command is
sent to the SEC whilst it is still processing the previous command, whilst
the second case may occur if a command is sent to the SEC during a
display cycle (button pressed). The command will not be executed and
the host should retransmit.
03 Invalid
d. <54> Cycle Data in Message
Counter /display
This error occurs when the SEC has been sent a valid command, but the
data associated with it is corrupt or outside an acceptable range.
04 Invalid
e. <54> Cycle Command
Counter /display
This error occurs when the SEC cannot decode the command byte of the
message, or that command has been disabled.
This error occurs when the data written to the EEprom could not be read
back and verified. The most likely cause of this error is EEprom failure.
06 Fingerprint
g. <54> Requested
Cycle Counter /displayWhen Not Set
This error is generated when the host requests the fingerprint value but
it has not been set. This error is unlikely to occur, as the fingerprint is set
at SEC manufacture.
07 Firmware
h. <54> Checksum
Cycle Counter Failure
/display
This error occurs when the SEC internal program has been corrupted in
some way. The SEC will check its program integrity at every power up
cycle.
i. EEprom
<54> Bus
Cycle Failure
Counter /display
This error occurs when the SEC does not have control of the bus lines to
the EEprom. Before a read or write is performed, each bus line is driven
high then low to ensure it is not being shorted to supply or ground or any
other bus line. This is to make sure there are no fraud attempts such as
shorting out pins on the SEC PCB.
j. 09 Receive
<54> Buffer Overflow
Cycle Counter /display
This error occurs when a packet is received that has a data count bigger
than 12 bytes. As this would overflow the allocated buffer size, the
incoming packet is truncated and this error is generated.
80 Single
k. <54> Cycle EEprom
Counter Checksum
/display Fail
This error occurs when the counter data read from the EEprom has a
checksum that does not match the calculated checksum. This may occur
if the SEC is reset during a write cycle to the EEprom and data is
corrupted, or it may happen as a result of failure of the EEprom device
itself. The host should not re-transmit after this error, as the SEC can
repair the data error from another (good) copy of the data in the EEprom.
This error occurs when both copies of the counter data in EEprom have
checksums that are incorrect. This is most likely due to a serious multiple
failure of storage locations within the EEprom or fraud attempts and
means the SEC can no longer be considered to operate reliably. A SEC
that has generated this message should be replaced.
82 Comm’s
m. <54> Time Out
Cycle Counter /display
The command / data being transmitted has not been completed within
the allocated time. All commands must be completed within 1 second of
the first byte being sent - this includes the command and any data strings
sent. If a time -out error occurs, the SEC will clear the input buffers and
wait for a new transmission. The command will not be executed and the
host should retransmit.
Portability
6. Commands
The SEC can be moved from one host to another to allow for replacement,
spares etc. Moving from one host to another will not clear down any counter
value information. If the SEC is moved between 2 hosts from different markets it
should automatically be updated with information on the new market from the
new host at the next host power up. The fingerprint should be checked by the
new host on power up and logged accordingly. This way, counter frauds
involving swapping counter units from machine to machine on a regular basis
can be detected.
It is not recommended to install or remove the SEC unit whilst the host
machine is powered up, as this may lead to internal damage.
Communications
1. Commands
Fingerprinting
2. Commands
Each SEC unit will be assigned a unique ‘fingerprint’ as a security code that
allows each SEC to be identified. The SEC fingerprint is a 32bit binary number,
allowing an unlimited number of individual fingerprints. The fingerprint can be
read at any time by the host machine to determine if an SEC has been changed
in the machine, allowing for frauds to be detected. Currently, the fingerprint is
assigned during production test using a combination of software and special
hardware. When the fingerprint is set, it cannot be modified or reset. The unique
SEC fingerprint is recorded at manufacture and used for quality control, parts
tracking as well as security.
1. Part
PartNumber
Number for Ordering
The part number D6C001-01-ZZZZ should be quoted when ordering the SEC.
Standard
2. Box QuantityBox Quantities
Standard
3. Standard Lead
Lead Time
Time
Description
The host sends a <23> request software revision, <ID> = 01.
The SEC replies <60> data available, with 3 bytes to show revision ‘02E’.
Description
The host sends <30> set number of counters to 05. With <ID> = 2
The SEC replies <61>. Acknowledge that command was OK.
Description
The host request the last <ID> number using <ID> = 03.
The SEC replies <60> data available and sends last <ID> number.
Description
The host sends an invalid command string with <ID> = 04 i.e. set counter command
without defining the counter number (no data). The SEC sends a NAK header with
code 03 - invalid data.
Connector Type