|
|
![]() |
![]() |
![]() |
![]() |
![]() |
|
|
![]() |
MITTENTITEL |
![]() |
The following tips and tricks were written with greatest care. Nonetheless I will not take any responsibillity or be liable for any damages, including without limitation, special, indirect or consequential damages, or any damages, whatsoever resulting from use this information or rebuilding the described items. This conversion is off the normal limits and will the gurantee on the parts will be lost. Hardware For a change this project has no need to modify Carrera hardware. Blackbox and lap counter both have a connector to allow comunication with a computer. The communication uses serial signals with levels combatible with TTL and CMOS circuitry. To communicate with a computer it must have access to those signals. Neither PCs nor Macs have suitable connectors. Current computers use USB to communicate with external devices. FTDI offers a cable, whch converts a TTL-compatible serial interface to a USB interface. The cable comes with a single line connector which has to be replaced by a 6 pin MiniDin male connector. Drivers for Mac and PC can be found at FTDIs website. Alternatively you can use the PC Unit connection box from a Carrera Race Managment System and put this between lap counter and a common USB serial connector. Software In the side bar you will find a ink to an test application for Mac "OS X" 10.5, which does a little race management. In the meantime there is also iLap a complete RMS software for the Mac.
The software is for "proof of concept" only and not a full featured race managemnet system. Before using the software you must install the drivers for cable or USB converter depending on your setup. The software will recognize the lap counter only if the lap counter is already switched on, when the software is launched. After program start you will have to select the communication device to use. If a version string appears below the serial interface name, the connection has been made and the lap counter will show:
The lap cunter wil stay in this mode and will not show any lap times while in PC mode. Now you select lap count or race duration and select the race mode laps or time. When you press the start button on the blackbox, the ordinary start procedure will follow. As soon as the starting lights go off the race status will change to Start and after about 5 seconds to Rennen (race). When the status changes to Start the times will be reset and the total time begins to run. After each crossing of the starting light (except the first one) lap times are updated and when the leading car crosses, the number of laps are changed. Is the race end reached, either lap or time limit depending on mode, the status changes to Pause and no further lap times are registered. When you press the start button on the blackbox again, it starts all over. When you widen the window, the lane time display will enlarge for better visibility. Lookout What can you expect from a software connected to a lap counter, where are the limits ? With the current firm- and hardware you can wirte software based on a race start signal and lap times. That is more than I can describe in some short sentences, but much less than I hoped for. Things I'm missing, but wich are currently not available:
When you add an protocol reade (like my little USB device) you can implement:
With a firmware change all my wishes could come true. But for the power control an additional connection from computer to blackbox would be needed. Data protocol for self programming As told before the communication is done via a serial interface. The parameters are 19200 baud , 8 bit, no parity , 1 stop bit. All communication is controlled by the computer. The lap counter answers to the computer it does not transfer data without request. The computer must poll the lap counter all the time. There are read and write commands, but the write commands are currently not used. Readcommands(reading from the lap counter) In the text I use red for all data sent by the computer and blue for all data sent by the lap counter. A command is initiated by a double quote followed by a printable ASCII value like "H. Thze lap counter will answer by repeating the command character and that followed by the data a checksum character and a dollar sign. I.E: H11$. All transferred characters are always printable ASCII values. They might be interpreted as literals or as binary values. If used as binary values only the lower 4 bits of a value are valid. The abouve example uses the literal 1. In the transmission ">><?;$ the data represents a binary byte value. A byte value is formed by two consecutive characters low order nibble (4 bits) first. in our example the lower 4 bits come from < and the higher 4 bits from ?. The ASCII values are $3C and $3F. The bytes value is $FC. Values longer than a byte are transferred bytewise the most significant byte first. The checksum is calculated by adding the lower 4 Bits of all data characters. Any overflow will be ignored and the result will be ored with $30. For our example this will be:
When there is no data available the lap counter will answer with a # after the repeated command character. Like in : "??# When the computer sends an unknown command the lap counter will send a # instead aof repeating the command character. Writecommands(Writing to the lap counter) The transfer starts with an double quote followed by the command character. The lapcounter aswers by repeating the command character. The computer transmits the data followed by checksum and dollar sign just as described above. The lapcounter will acknowledge the transfer with a closeing $. It looks like : "::??>$$ Commandset The commandset is based on that of Carrera's RMS. So it's rather large, but ost commands do nothing, because this lap counter does not offer the respective functionality. There are commands for setting driver names or switching track power, all things that the lap counter does not support. What's left are commands "0 (zero), "H and "? . They all are readcommands. "00NNNNC$ The four N are ASCII-Numbers, which represent the version numbers of hard- and firmware. C is the checksum. And a dollar sign signals the end of transmission. "??# oder "??FBBBBBBBBC$ The computer requests information about a new crossing of the starting line. Hasn't there been any since the last request, the lap counter answers with ?#. Has ther been a crossing the first character after the ? ist the id of the car crossing. The following 8 characters form a 32 bit binary value. This is the absolute time at which the crossing occured. To get the lap time you will have to subtract the values of two consecutive crossings of the same car. C is the checksum. And a dollar sign signals the end of transmission. "HHSC$ Requests race start information. The data character is always a 1, except for 5 seconds after the starting lights went out. During this period the data character is a 0. C is the checksum. And a dollar sign signals the end of transmission. |