1 / 19

Designing a USB Enabled Sensor Interface for Data Acquisition

Designing a USB Enabled Sensor Interface for Data Acquisition . Chris McMurrough April 3 rd , 2008. Overview. Introduction Basics of embedded USB Introduction to the PIC18F4550 Circuit and PCB design using Eagle Layout Editor PCB fabrication Working with SMDs

paniz
Download Presentation

Designing a USB Enabled Sensor Interface for Data Acquisition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Designing a USB Enabled Sensor Interface for Data Acquisition Chris McMurrough April 3rd, 2008

  2. Overview • Introduction • Basics of embedded USB • Introduction to the PIC18F4550 • Circuit and PCB design using Eagle Layout Editor • PCB fabrication • Working with SMDs • Programming the PIC18F4550 with CCS C Compiler • Using the device in Windows

  3. Introduction • Suppose you are designing a PC application that must take input from various types of real world sensors. How can this be accomplished? • Data Acquisition Card • Expensive, usually occupies a PCI slot, not very portable, requires a specific API, many interfacing options absent, not programmable • Data Acquisition Module • Expensive, usually bulky, requires a specific API, many interfacing options absent, not programmable • Microcontroller with RS232 • Requires a level translator and power supply • There is an alternative…

  4. Introduction (continued) • Microcontroller interfaced via USB • Many interfacing options available on one chip • No external power supply required • Fully programmable • No special API required • Inexpensive • Small in size • Can use as many devices as the host USB bus will support • The bottom line • This approach allows you to build a fully customizable device for data acquisition and control

  5. Basics of embedded USB • There are two types of hardware USB interfaces available for microcontrollers • Off-chip USB transceivers, such as FTDI • On chip USB transceivers, such as on the PIC 18F4550 • There are many software interfaces that can be used • Bulk Transfer • Interrupt Transfer • HID (Human Interface Device) • VCP (Virtual COM Port) • The basic USB device consists of… • Hardware interface • Software interface • Driver for host PC

  6. Introduction to the PIC18F4550 • USB capable microcontroller from Microchip • Requires minimal external components • Many interfaces available • A2D • GPIO (General Purpose IO) • UART • I2C (Inter-Integrated Circuit) • SPI (Serial Peripheral Interface) • USB • PWM generation and capture (Pulse Width Modulation) • Specifications: • Clock: 8 MHz, Up to 48 MHz with external oscillator • RAM: Up to 2 Kb • Program Space: 32 Kb • Data EEPROM: 256 bytes • Full speed USB 2.0 transceiver

  7. Circuit and PCB design using Eagle Layout Editor • Complete solution for Printed Circuit Board design • Allows you to create circuit schematics, and then board layouts • Signal traces are automatically routed • Projects can be exported into files suitable for manufacture • Freeware version available for boards under 4 x 3.2 inches

  8. Step 1: Schematic Editor

  9. Step 2: Layout Editor

  10. Step 3: Autorouter

  11. PCB fabrication • Once board design has been completed, they can be manufactured • The design is exported to a manufacturing format, such as a GERB • The GERB is sent to a manufacturer • Average turnaround time, about 1 week • Cost for a single board is about $30 • Cost per board drops dramatically as volume increases • Manufacturers often sponsor student projects or offer substantial discounts

  12. While we are on the subject…

  13. PCB fabrication (continued)

  14. Working with SMDs • Surface mount devices are a class of components that are soldered onto the metal pads on the PCB • Advantages • Much smaller than through-hole • Can be mounted quickly with practice • Overall produces higher quality solder joints • Disadvantages • Requires hot air rework station, which can be expensive • Can be intimidating at first

  15. Working with SMDs (continued) • Mounting process • Solder paste is applied to PCB pads • Component is placed on pads • Hot air heats the component, causing the solder to become viscous and adhere to pads and component pins • Process is repeated until everything is mounted

  16. Programming the PIC18F4550 with CCS C Compiler • CCS C compiler is a popular compiler for PIC devices • The usb_cdc library is provided for USB communications • Library functions behave exactly like a serial port • getc() -> usb_cdc_getc(); • putc(char) -> usb_cdc_putc(char); • kbhit() -> usb_cdc_kbhit() • usb_cdc_init() enables the interface

  17. Using the device in Windows • Install the CDC driver (it is probably already there) • When plugged in, the device will appear as a COM port • In your program, just read and write to the port • You can select any baud rate you want, the driver handles the rest • Using .NET, just include System.IO.Ports and create a SerialPort object

  18. Links • Eagle Layout Editor • www.cadsoft.de • Advanced Circuits • www.4pcb.com • CCS C Compiler • www.ccsinfo.com • Surface mounting video (time permitting) http://www.youtube.com/watch?v=0O2UEGLJeAI

  19. Questions?

More Related