Tools->USBLab

The USBLab is an interfase highly reconfigurable board, developed in 2006 around the Microchip microcontroller PIC16F877, that supports the connexion of different types of hardware (including a big variety of sensors and actuators) to the USB port of a PC with Windows and the communication of the PC and the hardware using different programming languages such as C, Matlab and Simulink. In other words, it is a hardware and software tool that permits any PC running Windows with a USB port control or monitorize the behaviour of a big variety of hardware elements.

In the following, we present the main characteristics of the hardware and software that constitutes the USBLab, as well as some information of the existing examples provided with it .

Which hardware is available?

The USBLab is a data adquisition board that supports the communication of the laboratory PCs with different types of systems taking advantage of the configuration and programming possibilities of the PIC16F877, a microcontroller by Microchip with USB connectivity support that is ideal for developing control and monitorizing tasks. The PIC16F877 has 40 reconfigurable pins that can be used as digital inputs/outputs, up to 13 analog inputs, or to comunicate with other hardware using the I2C, SPI and USART communication protocols. Besides the PIC16F877, the USBLab also includes a USB connector, a reset and reprogrammable buttons, 2 status leds, a MCP4921 DAC, and a 40 pin bus connector that provides external access to all the microcontrollers input/output signals.

The connectivity of the USBLab data adquistion board can be extended by a set of already designed extenxion boards. For instance, the analog input/output extension board includes the necessary components to facilitate the connexion of the USBLab with analog input/outputs signals within the ±5V range. The radio communication board includes the necessary components to support the communicaton of different USBLab boards via radio. The motors board includes the elements to control up to 1 DC motor, 1 step motor, and 4 servos. Combining the hardware associated to different boards or including new elements in it (for instance a bluetooth JY-MCU), extensions boards for specific applications can be easily designed by the USBLab users.

Which software is available?

Microchip also provides the Windows PC drivers and the microcontroller C program that permits the exchange of information between the PC and the PIC18F4550 through the USB. Our software, for the board and the PC, extends the micro functionality, by supporting, with the help of the communcation extension boards when required, the communication between the PC and the USBlab via USB, radio, the serial port or bluetooth, and the communication between the USBLab and multiple types of commonly used dispositive.

The software for the board consists in a set of template-projects and library functions. The first set provides the functionality to use the USBLab connected to the PC via the USB port, serial port or bluetooth; connected to the PC via the USB as a radio server; unconnected as a stand-alone board or as a radio client board; or connected to other systems as an I2C slave. The second set provides the functionality to generate/ read frequently used signals from the elements connected to the board. In order to develop new programs for the USBLab, the users have to select one of the template-projects and incorporate the calls to the functions of the library or to their own code.

The software for the PC is a set of libraries in C, Matlab and Simulink that support the communication with the board from the PC either via the USB port, serial port or bluetooth. Therefore, users of the USBLab can control different types of elements from a PC . Besides, for a quickly application development, the Matlab library also includes the communication calls associated to the library functions of the board.

Finally, it is worth noting that the microcontroller of a USBLab connected to the USB port can be easily re-programmed from the PC, using the bootloader program provided by Microchip for the PC. In order to do that, a bootloading firmware, which takes into account the USBLab layout, has to be downloaded in the microcontroller with a programmer.

Which examples are available?

In the examples sections we include the hardware and software for the different setups (stand-alone, USB, bluetooth, USB-radio-server, USB-client) of the USBLab connected to different basic systems (I2C compass, DC motors, step motors, servos, ...) and some advanced ones (a robotic arm).

Overview of the whole system

The relationship between all these elements is schematized in the following figure.

USBLab overview