USB Communication Board

From Mech
Revision as of 16:45, 4 September 2012 by DavidMeyer (talk | contribs)
Jump to navigationJump to search

***Under Construction***

Overview

The NU USB Communication Board is a universal communication board which serves as an interface between PCs and embedded systems. Using a PIC32MX250 chip, the board translates between USB HID communication and low-level microcontroller communication protocols, including RS232, I2C, and SPI. This board is useful in circumstances when fast, reliable communication is desired between a microcontroller and PC, but resources are not available on the microcontroller to run a full USB stack.

Using the USB Communication Board

The board operates in one of four modes: RS232, RS232 with Hardware Flow Control, SPI, or I2C. This mode is selected upon board power-up by the CommSelect jumpers on board. The selection criteria are shown below

  • No Jumpers - RS232
  • CS1 Jumped - RS232 w/ Hardware Flow Control
  • CS2 Jumped - SPI
  • Both Jumped - I2C

RS232

In RS232 mode, the communication board will read in any characters over the RS232 U1RX line and send them in 63 byte packets to the computer via USB. The zeroth byte of the USB 64-byte packet describes the length (N) of the data packet being sent to the computer, and has a maximum value of 63. Bytes 1 through N are filled with the pertinent data being sent to the computer. Bytes N+1 through 63 are meaningless. Each one of these packets is sent out every millisecond, for a maximum throughput of 63 kB/s.

Any packets received from the computer will be fed out the U1TX line. Again, the zeroth byte of the packet from the computer should contain the number of relevant bytes, as to not bog down the U1TX line with meaningless data.

RS232 w/ Hardware Flow Control

This mode operates under the same principle, but uses the U1RTS and U1CTS lines for flow control. This allows for higher baud-rates, and possibly higher-speed communication.

SPI

Not yet implemented

I2C

Not yet implemented

Source Code

9/4/2012 -