Interacting with Microchip Full-Speed USB USB Demo Board

Visit  home page for more
USB related articles.


Interacting with Microchip Full-Speed USB Demo Board using Visual Studio Tools (Part I) - Introduction

Download the source code for VC++ Example







The next section covers Windows Basics. Click here to goto next section.
While going through the USB forums I found out that there are many questions on how to develop PC applications for Microchip Full-Speed Demo boards by using MPUSBAPI.DLL. To answer one of the questions on Microchip USB forum, I developed a small application in VC++ which uses MPUSBAPI.DLL.

In this article, I will explain the technical aspects associated behind this application. And in subsequent articles I will explain how to use the MPUSBAPI.DLL library in Visual Basic.NET and C#.NET.

The Microchip Full Speed USB Demo Board is a great tool to learn USB and even for developing prototypes. The board comes with a PIC18F4550 device which is a USB part from Microchip. The board can be self-powered or bus-powered. It has a temperature sensor and potentio meter. It also comes with an expandable bus architecture (PIC-Tail Plus), which helps in prototype development.

Apart from these hardware features the board also comes along with a set of firmware examples and PC application examples. And the famous Demo Tool GUI which supports Bootloader features and Demo features. The board comes with a default factory hex file which has these two operations implemented. The Bootloader feature is always tempting for the end users like me. By using Bootloader I can reduce the cost of buying an ICD. The Demo Tool GUI is good enough to start with. But, I wanted to develop my own GUI and integrate the Boot example in my application. I am still on the learning curve on how to use it and develop GUI for the bootloader. In future I will post an article on it once I am done :-).

But, before that, I will explain how to interact with the Demo portion of the default factory hex file. Which is nothing but Demo option in the PICDEMFS Demo Tool.

How to develop an application that interacts with Demo firmware?

1. Download the MCHPFSUSB.ZIP from Microchip USB site and install it. This installation will have following directory structure.
Microchip Fullspeed USB Directory Structure

2. The PICDEM FS board should have been programmed with either the factory HEX (which is available in C:\MCHPFSUSB\fw\_factory_hex) or with the HEX file from Demo firmware example (which will be available in C:\MCHPFSUSB\fw\Demo\_output after compiling the Demo project).

3. The functionality provided in the C:\MCHPFSUSB\Pc\Mpusbapi\Dll\Borland_C\mpusbapi.dll need to be understood and learnt. To learn this file, refer to the file C:\MCHPFSUSB\Pc\Mpusbapi\Dll\Borland_C\Source\_mpusbapi.cpp. The developer of this DLL had put lot of effort in explaining each of function and how to use it. We will see more about these functions later.

4. And finally you should understand the code provided in the C:\MCHPFSUSB\fw\Demo folder. This code has two parts, USB Stack(All other files related to USB) and the USER application (user.c and user.h in C:\MCHPFSUSB\fw\Demo\user\) code. If you go through the code little more, you can see how the endpoints are defined, how the hardware is configured etc.. But, as this article is concentrating only on the PC application development with Visual Studio we will be learning more about user.c.

Ok, it is time to learn some theory.

Click here to goto next section.
Shop for USB Devices

Books and Gadgets

Site Resources

External Resources

Contact Us



Copyright 2006, www.comvcon.com