2013年10月26日 星期六

Chrome App (2) - Microchip USB

Use Chrome App to control Microchip PIC18 through USB interface.
Chrome App から Microchip PIC18を制御
以Chrome App 通過USB 控制 Microchip PIC18

  Last time, I use Chrome App, to control Arduino through serial API, before I go further, I want to try another combination first - Chrome App + Microchip + USB API.
  Nowadays, because of Arduino, Atmel AVR micro controller become very popular. Actually, Microchip's PIC series micro controller are another good options. Microchip provide a lot of samples codes for PIC, such as WSN, TCP/IP and USB. For the USB sample codes, they not only provide firmware source code, but even Windows, Linux and even Android application sample codes.
  One of the USB sample code come with PC demo application using the famous libusb library. Since the Chrome App's USB API is actually based on libusb, so it is quite easy to port the Microchip sample code to Chrome App.
   Here I make a simple demo Chrome App, press the button "Toggle LED", then a USB packet will be sent to the PIC18 (through Bulk mode transfer). When the firmware receive a command "0x80", then it will toggle the LEDs. The firmware source code is come from Microchip, I didn't modify but only compile it,

You can find my Chrome App code here.
https://github.com/winghackerspace/chromeapp_sample/tree/master/microchip_libusb

You can Microchip sample code (including firmware, Linux and Windows demo application) here.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en547784


沒有留言:

張貼留言