Cctalk Serial Interface

Published on 19 August 2013 Things like cheat engine.

Coin acceptor

A coin acceptor is a device that can recognize various types of coins based onits weight, shape, size and more (all depends on the device and themanufacturer). Usually, all the different coins it can recognize are separatedin what are called validation channels, which means one coin type is assignedan ID.

  • The Fritzing ccTalk interface misses a common ground from serial TTL connector to ccTalk connector, don’t forget to add this connection on the interface board to avoid burning the Arduino board. The board connector looks like the AWP industry-standard interface from page 20 in the part 1 ccTalk documentation.
  • 4.1 24-05-01 Modification to recommended cctalk interface circuit ‘Circuit 1 - cctalk Standard Interface’ 4.2 05-10-01 Addition of connector type 9 for serial universal hopper.
Cctalk

The Flow hopper is available in two interfaces. Standard parallel interface or ccTalk serial interface. Supplied with standard quick-fit and release plate. Features: Compatible with other popular hopper devices. One configuration for euro coins. From €0,20 to €2.00 coins. Disk can reach a payout speed of 7 coins per second for euro's.

Coin acceptors usually can recognize up to 16 different coin values, andeach of them is assigned one of those validation channels. These devices alsohave at least two sorter paths, which define the path the coin will take basedon the fact that the coin has been recognized or not. The two main paths are the'good coin' path (generally inside the machine) and the 'error' path, whichnormally gives the coin back to the customer.

Data request

To actually get the data from the coin acceptor, the controller must issue arequest with header 229 - Read buffered credit or error codes. The coinacceptor will respond with eleven bytes, containing the following information :

  • Counter is an event counter. Each event will increase this value.
  • Result is stored in two bytes. Usually, the first byte contains thevalidation channel and the second contains the error code (OK, bad coin,mechanical error, ..) I said usually, because some acceptors invert the tworesult bytes, resulting in many errors when trying to figure out what happenson those devices. When in doubt, refer to the product documentation.

Since the coin acceptor will return the validation channel value, thecontroller will need to know which coin type is associated with each ID. It isthen mandatory to know this association to be able to process different coinsproperly.

Interfacing with a coin acceptor

In the previous article, we saw how to create ccTalkpackets and requests. Now, let's interface a coin acceptor, handle its returned dataand process it !

Initialization

First of all, You have to make sure that the coin acceptor is online bysending a sample poll packet and get the response.

Coin acceptor setup

The coin acceptors need to be initialized prior accepting coins. The two mainthings to do are to set the inhibit status, which define which validationchannels are enabled on the coin acceptor. This can be done using the header 231- Modify inhibit status with two bytes of data. Each bit in the bytes representa validation channel (little-endian).

The second thing is to enable the coin acceptor, which is often not done bydefault. To do this, we need to send a request with header 228 - Modify masterinhibit status and 0x01 as the data byte - which means enabled.

Data request and processing

Cctalk Serial Interface Example

Now that the coin acceptor is ready, it needs to be polled regularly (specs sayevery 200 milliseconds, but it can be more) and the returned data needs to beparsed and processed.

The counter starts at zero on initialization, and increments up to 255. It willthen loop from 1 to 255 and so on. Processing the data is quite simple once youknow which coin is what :

  1. Send a request with header 229

  2. Get the response data

  3. Check the counter value.

    If the value is greater than the previous one, check the corresponding number of results

  4. Depending on the error code returned, process the coin ID that has been accepted

  5. GOTO 1

Example code

The following Python code uses the ccTalk library presented in last post It shows a basic coin acceptor initialization andpolling, and can be enhanced to support other functionalities :

Teensy implementation

I also created a simple ccTalk controller that can be used on an Arduino or aTeensy device. The code available here polls a coin acceptor and willsend the corresponding amount of keystrokes to the host computer. The purpose ofthis was to add a coin acceptor on my MAMEcab to add a more realistic feelingwhen playing.

Here is a (crappy) demo of it in action. Codevisionavr keygen torrent. You can actually see the credits changewhen I insert a new coin :

In the next post, we'll start messing with a ccTalk bus by injecting data andsee what can be done once you have a physical access to the bus.

The Null-modem emulator is an open source kernel-mode virtual serial port driver forWindows, available freely under GPL license.

Cctalk Serial Interface

The Null-modem emulator allows you to create an unlimited number of virtual COM portpairs and use any pair to connect one COM port based application to another.Each COM port pair provides two COM ports. The output to one port is the input from otherport and vice versa.

Cctalk Serial Interface

The Null-modem emulator can be used to provide serial interface for device emulators.In this case the device emulation program uses one port of the pair andthe other port can be used by Windows or DOS application thatrequires a COM port to communicate with the device.For example, to send/receive faxes over IP you can connect WindowsFax application to t38modem (T38FAX Pseudo Modem ,part of the t38modem project ) via virtual COM port pair.

The Null-modem emulator can be used to provide serial interface for COM port redirectors.For example, with the com2tcp (COM port to TCP redirector,part of the com0com project ) you can communicate via serial interface with the TCP/IP servers.If you feel that com2tcp is what you need but can't find some required features (for example RFC 2217 support) then try use hub4com instead.

Cctalk serial interface software

With the hub4com (HUB for communications,part of the com0com project ) it is possible to handle data and signals from a single serial device by a number of differentapplications (for example, several applications can share data from one GPS device).It's also possible to use the real serial ports of remote computer like if they exist on a local computer.

You can find more information inUsing com0com and com2tcp,ReadMe.txt for com0com,ReadMe.txt for com2tcp,ReadMe.txt for hub4comand onSourceForge Projectpage.



Alternatively, you can use Virtual Serial Port Driver by Eltima Software. It allows creating a large number of virtual COM ports and gives you great possibility to emulate serial port behaviour fully. Virtual Serial Port Driver provides flexible port creation, management, and removal, allows testing the software, supports control lines and high speed of data transfer with virtual port.


Cctalk Serial Interface Download

  • Create any number of virtual COM ports
  • Complete real ports settings emulation
  • Manage all signal lines
  • instantaneous ports creation lets working with them even before PnP manager detects the newly added ports;
  • full supports of Windows 10
You are welcome to download Virtual COM Port Driver.

Comments are closed.