DLP-TEMP-G USB / Data-Acquisition Module NOW LEAD-FREE Features: 3 Digital I/Os, 3 Analog Inputs (0-5 Volts) or any combination USB 1.1 and 2.0 Compatible Interface th 4 Generation Silicon from FTDI Supports Up To 3 Digital Temperature Sensors Applications: Data Acquisition Temperature Monitoring INTRODUCTION The DLP-TEMP-G is a USB/microcontroller based 3-channel data-acquisition system preprogrammed with firmware for digital I/O or reading digital temperature-sensing devices. The DLP-TEMP-G board is equipped with a Type A male USB connector for direct connection to a USB port. No cable is required unless the board is to be located away from the PC, in which case a user supplied USB A-A (male-female) extension cable can be used. The digital temperature-sensing device supported is the Dallas Semiconductor DS18B20. Three of these sensors can be monitored simultaneously while connected to the DLP-TEMP-G via Category 5 cable at distances up to 200 feet. (For instruction on how to connect the sensors to the DLP-TEMP-G via Category 5 cable, refer to the Application section of this document.) All power for the DLP-TEMP-Gs circuitry and DS18B20 temperature sensors is taken from the USB port so no external power source is required. 1 The microcontroller used is the PIC12F683, 8-pin, Flash-based microcontroller from Microchip. As mentioned above, the 12F683 is preprogrammed for analog voltage measurement and for reading the digital temperature sensors, but it can also be erased and reprogrammed with user code if desired. Reprogramming the micro requires a user-supplied device programmer. (Refer to the schematic at the end of this document for the pin out of the programming header.) The microcontroller uses a single port pin and a pull-up resistor to communicate with each digital temperature sensor. Refer to the DS18B20s datasheet for a complete description of its communications protocol. The firmware for the DLP-TEMP-G was written in C and can be downloaded from dlpdesign.com. USB INTERFACE The USB interface was implemented using the FT232RL USB-UART IC from FTDI. This device connects to the host computer via the Type A USB (male) connector and supports the 8 standard RS232 serial signals. Only the TX and RX signals are used on the DLP-TEMP-G board and are all that is required to form a serial connection to the host computer. Since handshaking is not used in this design, the firmware in the 12F683 processor must be ready to accept all incoming serial data from the host computer or the data will be lost. In order for the DLP-TEMP-G (and FT232RL) to receive incoming serial data from the host, FTDIs VCP (Virtual Com Port) drivers must be installed. The driver installation process is initiated by simply plugging the DLP-TEMP-G into a USB port. The driver installation wizard will prompt for the location of the drivers files (in a folder or on a floppy) and will copy the required files to the proper destination such that the next time the board is connected the driver files will be automatically loaded without prompting the user. The VCP driver files can be downloaded for free from dlpdesign.com or ftdichip.com. Once the drivers are loaded and the com port number for the DLP-TEMP-G is set in Device Manager, the application program running on the host simply opens what it thinks is an RS232 port (9600, N, 8, 1) and begins communicating with the 12F683 microcontroller. COMMUNICATIONS PROTOCOL For this design, a rather simplistic protocol was selected in an attempt to present the design in as basic a way as possible. Single-byte commands are used to communicate with the 12F683 microcontroller. The following table shows the command list: COMMAND 12F683 Response R (read and convert) Send back 18 bytes of data from the sensors and start another temperature conversion in both sensors. Provided as legacy support for compatibility with the original DLP-TEMP. P (ping) Echo the letter Q back to the host. Provided as legacy support for compatibility with the original DLP-TEMP. S Read temperature sensor at S1, return data and convert 2