<DOWNLOADS>

Hardware

The heart of the system is SiLabs evaluation board with 342 processor. This board can operate using 3.3V power or USB power, C8051F34x processor has up to 48 MHz clock, USB , UART, 2 timers, 2 comparators, ADC, and digital in and outs.

The board has 4 lines of input/output P0,P1,P2,P3 with 8 (and 1) pads, each input/output can be programmed to perform different analog or digital in and out. For our purpose we will use them to connect scales, for either reading or switch the mode, power the scales, control points and serial (UART) Tx and Rx. Onboard switch will be used to toggle fast/slow modes (in addition to toggling from the software), the P2.2 Led will indicate the mode of operation. The only element which is not used is a potentiometer (and ADC). Connector at left is for BaseAdapter to upload the firmware (used only once). Connector at right is USB connector.

Perfect board for many toys! And relatively rare board with true USB support. Silabs even includes retractable USB cable with this $10 board!!

Schematic diagram

Solder parts according to the drawing. PX.X indicate pads available at the board. Some comments: LED (2 for each scale, if you are going to use 1 or 2 scales not necessary to solder all LEDs, only 2 for the scale). The LEDs will limit voltage to about 1.5V (the level of caliper electronics). 3 silicon diodes (P.1.7) connected in series are used to have power supply for the scales (~1.5V, connected all in parallel to this point) and provide reference point for minus input of 2 comparators P 1.1 and P 1.3 (for CLOCK and DATA signals). Control points are outputs of the comparators, at these points you can check output of the comparators with oscilloscope, the signals will be similar shown in the protocol description. These control points are for control only, they are not needed for operation. P 0.4 and P 0.5 are Tx and Rx pins of UART (serial). UART (serial) output is optional, with USB PC software it's not needed.

Here is a picture how I'm using this board in my implementation of the DRO box (with 2 scales attached), there are connections for 3 scales (top); UART (serial) (bottom-left connector) and USB (right). The LEDs are soldered directly to the pads of the board, at right you see one of 3 silicon diodes connected in series (P 1.7)(the other two are hidden by LED), blue wire attached to the diode is for power of the scales. All connections are made on the top of the board, except P1.1 and P1.3 inputs of comparators (the most right red wire goes to the bottom of PCB). The box is made of double side PCB cut with scissors and soldered from parts. The size of the box is about 53x53 mm (2x2 inches).

 

I made a hole for the LEDs to have some additional indication (not necessary). When hardware switches between fast/slow mode corresponding pair of LEDs flashes indicating that this scale was detected as operational (only detected at the initiation scales will be forced to toggle fast/slow mode). Actually PC software shows the state of scales at startup while performing test cycle (at the status bar), so the indication with LEDs is optional. While testing, you can also see additional indication looking at the small LED mounted on PCB board. Its blinking while testing, after that glow indicates the fast mode. The onboard button can be used to switch fast/slow mode.

The connectors (male) are the same to the ones used for calipers mouser.com part number 798-DF3Z-4P-2H20, manufacturer part number DF3Z-4P-2H(20). The cable-side connector (female) is mouser.com part number 798-DF3-4S-2C16, man. part number DF3-4S-2C(16). Do not forget to order pins (I forgot), they are not included to female connector.

Firmware

Serial (UART)
set to 19200 8-n-1.

Here is an example of the output with 2 scales attached. First system check for the scales. It takes a few seconds. The reading comes in 3 32-bit hex numbers, there are always 3 numbers, if one of the scale is not attached zeroes will be shown. As per protocol description (see overview section) the output is in units of 1 inch/ 0x5000 (hex) or 1inch/20,480 (decimal). To get true values these numbers should be converted as follows: a) inch: Nx/0x5000 b) mm: Nx*25.4/0x5000, where Nx is corresponding output number. To toggle between fast/slow modes a "f" (0x66) character should be send to UART. In the example first scale sends close to 0 positive values, second scale sends close to 0 negative values, and for the third scale zeroes are always shown (the scale is not attached).

USB
I program microcontroller to claim USB as a HID device with VID=0x010c4 (Silicon Laboratories) and PID=0xaaaa (chosen arbitrary). The output report is 50-byte-length string which corresponds to the serial strings shown above. Report ID for the output string is 0x2; report ID for the input (to toggle between fast/slow) is 0x1, expected length is 1 byte (the same 0x66 code should be send from PC to toggle modes).

Firmware

 

USB_DRO firmware file (available at the download section) can be uploaded to the processor via BaseAdapter with Silicon Laboratories IDE program (available for free from silabs.com site, see overview section).