[PIC] Pickit 2 firmware available from the shipped CD
Chen Xiao Fan <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.gnupic,gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <3B8AEFFADD3DD4118F8100508BACEC2C07F774AB@spex> |
I just received the PICkit 2 from buy.Microchip.com. To my surprise, the firmware source code and the PC host application code (using Borland C++ Builder V6) are available in the x:\Unsupported directory (x is the cdrom drive). Sorry for the cross posting but I think this is good news for the GNUPIC community as well. I am going to try to port usb_pickit (Linux and Windows) to the PICkit 2. I do not have access to Borland C++ builder anyway. Regards, Xiaofan ----------------------------------- 18F2550 source code remade ----------------------------------- 2005-05-16 README The PICkit 2 Operating System (firmware) source code was written using the Microchip Full Speed USB code base. The source code is compiled with MPLAB C18 compiler. Unzip the file "PICkit 2 PIC18F2550 Ver. X.X.X 200X-XX-XX.zip" in the root directory and rename the directory to "PICkit 2 PIC18F2550". This will keep the project directory structure intact. ----------------------------------- PC source code notes for usbhidioc.cpp ----------------------------------- Date: 23 Nov 2004 Dan Butler, Microchip Technology Version 1.0, Based on Jan Axelson's ([email protected]) USBHIDIOC V2.0 Implements PC to device communication via the HID driver. Written for Borland C++ Builder V6 Access is through three functions: WriteFile ReadFile CloseFile Both Read and Write functions check to see if the device is opened on each call. If not, it goes out and looks for the device and opens the file. On failure, the channel is closed so it will attempt to reopen the device on the next call. bool WriteFile (char *buffer) Assumes the contents of the buffer is correct and appropriate for the end device. It adds on the 0 to the beginning of the buffer and sends it to the HID driver, which formats it and sends it to the device. bool ReadFile (char *buffer) Returns the buffer read from the device. Project: usbhidioc.cpp Version: 2.0 Date: 12/20/00 by Jan Axelson ([email protected]) Purpose: demonstrates USB communications with a HID-class device using overlapped I/O. Description: Finds an attached HID-class device that matches specific vendor & product IDs. Retrieves the device's capabilities. This application was created with Borland's C++ Builder 6's. About overlapped I/O Reading HID input reports is done with the API function ReadFile. Non-overlapped ReadFile is a blocking call. If the device doesn't return the expected amount of data, the application hangs and will wait forever. With overlapped I/O, the call to ReadFile returns immediately. The application then calls WaitForSingleObject, which returns when either the data has arrived or the specified timeout has elapsed. */