Showing posts with label PIC. Show all posts
Showing posts with label PIC. Show all posts

Saturday, April 16, 2011

Updated Microchip USB Links and Microchip Stack Anomaly list

PIC USB related web sites
http://www.microchip.com/forums/m123533.aspx

PIC USB Firmware Framework Confirmed and Potential Anomalies
http://www.microchip.com/forums/m275422.aspx

The above links should help the users of Microchip USB PICs.

Saturday, March 6, 2010

picusb Google code page updated

http://code.google.com/p/picusb/

I have created this page quite some time ago. But I did not put anything inside. Now I will start to put some contents inside, mainly related to some open source codes related to USB PIC MCUs.

Some files for download:
http://code.google.com/p/picusb/downloads/list

Tuesday, November 11, 2008

RTOS Links Collection for Microchip MCUs

http://forum.microchip.com/tm.aspx?m=381449

There are many interesting discussions in the Microchip Forum
about RTOS. There are also more and more RTOS produced for
Microchip MCUs, especially after the introduction of bigger
PICs like dsPIC30, PIC24, dsPIC33 and PIC32.

Friday, August 1, 2008

Two Trivial Patches now in Linux Kernel 2.6.26

I am not a Linux kernel hacker, actually I am not even a programmer.
But I've got two trivial patches about USB PICs in Linux kernel 2.6.26.
So it seems we can help the open source community no matter how minor
the contributions are.

http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.26
********************************************************
commit 5fc89390f74ac42165db477793fb30f6a200e79c
Author: Xiaofan Chen
Date: Tue May 13 21:52:00 2008 +0800

USB: remove PICDEM FS USB demo (04d8:000c) device from ldusb

Microchip has changed the PICDEM FS USB demo device (0x04d8:000c)
to use bulk transfer and not interrupt transfer. So I've updated the
libusb based program here (Post #31).
http://forum.microchip.com/tm.aspx?m=106426&mpage=2

So I believe that the in-kernel ldusb driver will no longer work with the
demo firmware. It should be removed.


Signed-off-by: Xiaofan Chen
Cc: Michael Hund
Cc: stable
Signed-off-by: Greg Kroah-Hartman
********************************************************

********************************************************
commit f4971031f4acd98423a2903c6517fb3ef1aea8dc
Author: Xiaofan Chen
Date: Tue May 13 17:11:59 2008 +0200

HID: add Microchip PICKit 1 and PICkit 2 to blacklist

Microchip PICkit 1 and PICKit 2 USB Programmers are USB HID class of device but
they are not real HID device. They are now supported by libusb based programs
like the following programs.

pk2 and pk2cmd Linux port:
http://home.pacbell.net/theposts/picmicro/
usb_pickit:
http://tfc.duke.free.fr/pickit.html
usb_pickit original version:
http://charm.cs.uiuc.edu/users/olawlor/projects/2003/microchip/

Therefore it is preferred to blacklist them.

Signed-off-by: Xiaofan Chen
Signed-off-by: Jiri Kosina
********************************************************

Reference:
http://www.ohloh.net/p/linux/contributors/13492639826017

Thursday, April 24, 2008

USB PIC related open source projects

Updates to be found in Microchip Forum:
http://www.microchip.com/forums/tm.aspx?m=235427

1. PUF using sdcc : http://vasco.gforge.enseeiht.fr/

"PUF is a USB application framework dedicated to Linux (on the host side) and to the PIC 18F4550 family of microcontrollers (on the device side). PUF includes: a bootloader that can flash the PIC application through the USB, a PIC demo and its corresponding application on the host side, and docker, the host-side flash programming utility.

2. PIC18F4550 USB/MSD sourceforge, Apache License V2.0
http://sourceforge.net/projects/pic18fusb

3) GPLed USB stack with SDCC
http://forum.microchip.com/tm.aspx?m=170553
http://www.nutsvolts.com/%7Edownloads/USB.zip

4) PICDEM FS USB bootloader for Linux/Windows using libusb
http://www.internetking.org/fsusb/
http://forum.microchip.com/tm.aspx?m=106426

5) PICDEM FS USB demo appliation under Linux/Windows using libusb
http://www.varxec.net/picdem_fs_usb/

6) PIC18F2455/4455 Assembler USB Firmware (MPASM) From Bminch
http://forum.microchip.com/tm.aspx?m=89669
http://pe.ece.olin.edu/ece/projects.html

7) MPLAB C18 based PIC USB firmware from Bminch (simpler than Microchip's)
http://forum.microchip.com/tm.aspx?m=125158
http://pe.ece.olin.edu/ece/projects.html

8) Microchip USB C18 Firmware framework ported to SDCC
http://www.efn.org/~rick/work/MCHPFSUSB/

9) USB Midi (using gpasm and sdcc). It is said that the firmware is also based on the Microchip Firmware Framework.
http://www.ucapps.de/mbhp_usb_pic.html

Thursday, March 13, 2008

Microchip Announced PIC32 USB OTG Device

Press Release:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2018&mcparam=en534270

Application Notes: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en534177

USB Host and Device Stack Download:
http://ww1.microchip.com/downloads/en/DeviceDoc/pic32mx_usb_v1_0_01.zip

WinUSB example from Jan Axelson

http://www.lvr.com/winusb.htm
Visual Basic .NET and C# host program and PIC firmware are provided.

I've tested it under Windows XP (with WDK 6000) and a home-made simplified PICDEM FS USB demo board. It works nicely. Take note that Jan is using a new version of WDK (6001?) and I need to change the INF file to reference to the old files. Also take note that Jan is still using an old version of the Microchip USB firmware framework.

Tuesday, February 5, 2008

Microchip USB Stack V1.3 Released

Download link:
http://ww1.microchip.com/downloads/en/DeviceDoc/MCHPFSUSB_Setup_v1.3.exe
Release notes:
http://ww1.microchip.com/downloads/en/DeviceDoc/Release%20Notes%20for%20MCHPFSUSB%20v1.3.htm

What's New/Updated in Release v1.3
1) Microchip General Purpose USB Windows® Driver, mchpusb.sys v1.0.0.6, is updated to support Windows Vista™ and 64-bit Windows® Operating Systems. This version is WHQL certified.

2) CDC RS-232 emulation INF file, mchpcdc.inf, updated for supporting Windows Vista™ 32-bit and 64-bit.

3) Some bug fixes in USB library firmware (usb9.c).

Friday, January 11, 2008

How to Get Help for Microchip MCU Related Questions

Someone just leaves a comments about asking for PIC related issues through Email. I'd suggest that one tries the following places.

1. Microchip Forum: generic problems with PIC MCUs and associated development tools
http://forum.microchip.com

2. PIClist
http://www.piclist.com

3. For Open Source PIC development tools under Linux or Windows: GNUPIC
http://www.gnupic.org

4. For PICkit 2 under Linux
http://groups.google.com/group/pickit-devel

Thursday, January 3, 2008

Long way to go: MCU Development without Windows

ICD2 debugging is one of the things which does not work well under Linux yet. Piklab project is the trying to bridge the gap but it will take some time for it to be good enough. So right now people have to run Windows (natively or under VMware or similar virtulization technology).

http://forum.microchip.com/tm.aspx?m=294340
I am not so sure if petition like this is really useful or not. Main MCU vendors only offer software based on Windows and this will not change anytime soon.

Still Atmel is offering free GNU toolchains (GCC based) and IDEs (Eclipse based, support debugging) for AVR32, under Windows and Linux.
http://www.atmel.com/dyn/products/tools.asp?family_id=682

So I am hoping Microchip could learn a bit from Atmel and try to do the same for PIC32. Take note Microchip C30 and C32 compiler are both based on GCC.
http://forum.microchip.com/tm.aspx?m=296597

There are some third party tools under Linux for PIC development. For example, HiTech offers PICC/PICC18/dsPICC under Linux and it now adding support for ICD2 debugging. HiTech tools are not cheap though compared to Microchip provided tools.

There are quite some good ARM MCU tools under Linux. So that is one direction to go. Still the most popular tools (from Keil and IAR, etc) are still Windows only.

It seems there is still a long way to go for Linux to be the productive environment for many electronics engineer (hardware and firmware).

Sunday, December 30, 2007

PICDEM FS USB Demo Board under Linux

PICDEM FS-USB demo board is the demonstration and evaluation board for the PIC18F4550 family of Flash microcontrollers with full speed USB 2.0 interface
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en021940

Back in 2005, people have developed application based on libusb to get it work under Linux. I have since patched them to work under Windows as well using libusb-win32.

Bootloader under Linux:
http://www.internetking.org/fsusb/
My latest patches:
http://forum.microchip.com/tm.aspx?m=106426

Demo mode which includes my patches for libusb-win32:
http://www.varxec.net/picdem_fs_usb/
My latest patches to detach kernel ldusb driver for later Linux kernels.
http://forum.microchip.com/tm.aspx?m=106426

Interesting discussion about the ldusb driver issue.
Thread: [PATCH 70/78] USB: add picdem device to ldusb:
http://marc.info/?t=117770076400003&r=1&w=2

To me I think it is better to do this in user space using libusb. But the original submitter wants to keep it as he did not know the existence of the libusb based application and has already an in-house application based on the kernel driver.

CDC-ACM demo works fine under Linux. The HID mouse demo also works fine under Linux.

Interestingly, again someone wants to add the bootloader to the kernel. Hopefully this time it will not be included. The libusb based application should still work but why adding so many things to the kernel space when the user space libusb based application works fine.
http://www.mail-archive.com/linux-usb@vger.kernel.org/msg00296.html

One FAQ is how to run the libusb based application as a normal user (without root credential). This is a moving target under Linux. Hotplug, udev, udev with PAM and HAL rules are the methods to achieve the goal. You need to choose the right one for the Linux distro you are using.

The following is a good summary.
http://www.gphoto.org/doc/manual/permissions-usb.html

An older document which does not cover HAL:
http://piklab.sf.net/files/libusb_udev_hotplug.txt

Some examples (not really for PICDEM FS-USB but for PICkit 1/2 and ICD2) you can use as the starting point:
http://piklab.sourceforge.net/wiki/index.php/USB_port_problems

Tuesday, December 25, 2007

Serial Port Based Intelligent PIC Programmers

I have wrote about USB based PIC programmers and simple PIC programmers. It seems that with PICkit 2 coming out, it makes less sense to use other serial based intelligent PIC programmers. Still some of the users may already have those simple programmers and want to build their own intelligent PIC programmers. In that case, here are some recommendations.

1. Wisp628A: http://www.voti.nl/wisp628/
You can build this relatively easily. Actually back in 2005, I've built two of this on a breadboard.
The alternative firmware and software from Rob Hamerling's xwisp2 (http://www.robh.nl/picsoft.php) is my preferred choice. It is cross-platform and supports OS/2, Windows, Linux, Mac OS X and FreeBSD.

You can either buy the kit and build your own or create your own based on the information on the site.

2. Easyprog: http://www.embedinc.com/easyprog/
The author (Olin Lathrop) provides the hardware design, firmware and software sources.
You can buy the kit and assemble by yourself. I do not think you would like to buy the ready-made kit since PICkit 2 may be cheaper and better. Embed Inc also has the ProProg
(http://www.embedinc.com/proprog/index.htm) which is aimed at production and USBProg (http://www.embedinc.com/products/eusb2/index.htm) which is aimed at profoessional lab and benchtop use. ProProg and USBprog seem to be both well designed.

3. Kitrus also has some kits. http://www.kitsrus.com/pic.html
The price may not be justified now that PICkit 2 is out and at only US$35 (not including tax and shipment).

4. Microchip PICstart+:
Some of the sites have the clones but I think this is not easy to be built by hobbyists and its feature is not as good as PICkit 2 even though it is more expensive than PICkit 2.

A survey of simple PIC programmers under Windows and Linux

Merry Christmas and Happy New Year!

I myself do not use any simple PIC programmers without a PIC as the brain of the programmer. Still some people think PICkit 2 is too expensive at US$35. So there is still a market for the simple programmers. Coupled with bootloader, it can still be useful for some hobbyists. Of course I will still recommend PICkit 2 to those who can afford the US$35, it is well worth the money and save you a lot of troubles with the simple programmers.

Windows simple PIC programmer software sites often links to the supported hardware. Some of them are based on Parallel port (eg: Tait), some of them are based on Serial port (eg: JDM), very few of them are based on USB. Parallel port and serial port start to disappear from many laptop computers. And many of the serial port based programmers will not work properly with common USB-to-Serial converters. Almost all Parallel port based programmers will not work with common USB-to-Parallel converter (often made for old printer). Some of the very simple programs only support LVP (low voltage programming) which only applies to very few PICs (but some of the PICs are popular). So far I can see that most simple programmers do not support 3V only PICs like PIC18J/18K and PIC24/dsPIC33 which PICkit 2 support well.

WinPIC:
http://freenet-homepage.de/dl4yhf/winpicpr.html
http://www.qsl.net/dl4yhf/winpic/index.htm
WinPIC supports many 5V PICs and its manual seems to be quite good. Another advantage is that the author also provides the source packages.

WinPIC800: http://www.winpic800.com/index.php?lang=en
It claims the support of most Flash PICs and can rival some of the features of PICkit 2. But take note that its main supported programmer GTP-USB+ is actually an intelligent PIC programmer and at 60 Euro it is much more expensive than PICkit 2 which costs US$35 . If you are using the simple programmer, I am not so sure if it still supports the same number of device.

PICPGM: http://www.members.aon.at/electronics/pic/picpgm/
PICPGM also supports quite some PICs. One interesting thing is that it has an FT245BL based USB programmer which unfortunately only supports LVP.

IC-Prog: http://www.ic-prog.com/index1.htm
IC-Prog is perhaps one of the most popular programing software in the web. However, its support of PICs is actually one of the weakest from the website.

Linux:
pikdev: http://pikdev.free.fr/
pikdev supports many simple programmers and PICs under Linux.

piklab: http://piklab.sourceforge.net/
piklab supports many simple programmers and PICs under Linux. Of course, it also supports many other programmers, including Microchip MPLAB ICD2.

picprog: http://hyvatti.iki.fi/~jaakko/pic/picprog.html
This is different from the maybe-better-known picprg (http://www.brianlane.com/software/picprg) but it is actually much better than that one.

Odyssey: http://vasco.gforge.enseeiht.fr/index.php?article=Odyssey.html
It only supports Parallel port based programmer. But anyway, parallel-port based simple programmers is said to be more reliable than serial port based simple programmers.

Friday, December 21, 2007

GPLed dsPIC33 MP3 Decoder Based on MAD

Finally this is done by Alex B in Microchip Forum. I am not into dsPIC much yet but I think this is really outstanding.

http://forum.microchip.com/tm.aspx?m=166133&mpage=4

Download (GPL licensed):
http://www.pic24.ru/upload/dspic_mp3.zip

It is based on MAD.
http://www.underbit.com/products/mad/

Saturday, December 8, 2007

USB Programmers for PICs

http://forum.microchip.com/tm.aspx?m=283491

As someone who has used PICKit 1, PICkit 2, ICD2, Promate II and Promate III and a follower of PICkit 2, I find it interesting that people still want to create yet another simple USB programmer.

Anyway, here are my classification of USB PIC programmers. I might miss many programmers in the lists but it pretty much show you the pictures. After class 3, then there are many high end programmers from Data I/O, BP or similar for mass production.

Class 1: Simple USB programmers (not as good as PICkit 2 and USBprog):
1. picsquirt http://www.p10link.net/plugwash/picsquirt/
2. GTP USB lite (somewhat like a USB version of Wouter's WISP628A) http://www.hobbypic.com/index.php?option=com_content&task=view&id=12&Itemid=35

Class 2: Good for personal and lab use
1. PICKit 2, good and cheap, supports many PICs and double as a debugger.
http://www.microchip.com/pickit2

2. Another good USB programmer is the Amadeus.
The author is aparently very knowledgeable about PIC programming specifications. Not many people understand it as thoughly as him. Olin may be one of them. http://home.arcor.de/bernhard.michelis/

3. The author of WinPIC800 software has the GTP USB+ Programmer which seems to be a decent programmer as well.
http://www.winpic800.com/index.php?lang=en

4. USBprog is a kind of higher-end PICkit 2 in terms of hardware functionality. USBprog hits a good spot between PICkit 2 and Promate III but I find its chip support a bit limitted compared to PICKit 2.
http://www.embedinc.com/products/eusb2/index.htm

Class 3: low quantity production quality programmer After class 2 then you have higher-end USB programmers like Promate III and SoftLog ICP2. SoftLog ICP2 seems to be a serious contender to PM3 at much lower cost.

Between USBProg and Promate III, there are still quite some good gaps. SoftLog ICP2 is a good attempt.
https://www.microchipdirect.com/ProductDetails.aspx?Catalog=BuyMicrochip&Category=Programmers&mid=13

Some PICkit 2 Links

PICKit 2 website:
http://www.microchip.com/pickit2

PICkit 2 Faq:
http://forum.microchip.com/tm.aspx?m=270347

PICKit 2 Wishlist:
http://forum.microchip.com/tm.aspx?m=260540

PICkit 2 under Linux, pk2 and pk2cmd Linux port:
http://home.pacbell.net/theposts/picmicro/

PICkit 2 versus ICD2:
http://forum.microchip.com/tm.aspx?m=287314
http://forum.microchip.com/tm.aspx?m=282776

Tuesday, November 20, 2007

Debian Template to Build GCC for dsPIC/PIC24

Microchip uses GCC as the base for its C30 compiler for PIC24/dsPIC30/dsPIC33. They have also published the source according to GPL requirement.

John Steele Scott has done some good jobs to patch the Microchip sources and provided the Debian templates to build debian packages.

Instruction for V3.01b (patches and Debian Templates)
http://www.nabble.com/Debian-templates-for-dsPIC-build-toolchain-3.01-t4308624.html

Old version V2.05
http://www.nabble.com/Debian-templates-for-dsPIC-build-toolchain-2.05-t2825194.html

Old version V2.00 and related information
http://forum.microchip.com/tm.aspx?m=139360

Saturday, November 10, 2007

Building Microchip PIC32 GCC Compiler from Source

Over the past few days, I learned how to build PIC32 (MIPS32 M4K Core based) Cross Compiler from provided GCC source under Ubuntu Linux.

This is documented in this forum thread.
http://forum.microchip.com/tm.aspx?m=292995

Thursday, November 1, 2007

Bootloaders for Microchip PIC MCUs

The following is a list of bootloaders for Microchip PIC MCUs.

Comments on 14-Mar-2010: The updated list is here:
http://www.microchip.com/forums/tm.aspx?m=424874

Commercial/Non-Free.
1. http://www.microchipc.com/PIC18bootload/ Non-free
2. http://www.microchipc.com/PIC16bootload/ free for no-commercial
3. http://kulesh-software.com/Software/USBPicBooloader/index.html
4. Ethernet bootloader
http://www.brushelectronics.com/index.php?page=software#EBL
5. http://www.auelectronics.selfip.com/Software.htm

Free from Microchip:
1. Microchip AN851: PIC16F/18F bootloader via serial
2. Microchip AN247: PIC18F CAN MCU bootloader via CAN bus
3. Microchip AN1094: PIC24/dsPIC30/dsPIC33 bootloader
4. Microchip TCP/IP Stack 4.1x: Internet bootloader for PIC18J Ethernet MCU
5. Microchip PICkit 2: USB HID Bootloader
6. Microchip USB Firmware framerwork: USB bootloader using generic USB driver

Free from third party:
1. ingenia free dsPIC bootloader:

http://www.ingenia-cat.com/

2. Tiny Bootloader. It also lists many other bootloaders.
http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
Some of the listed bootloaders in the Tiny Bootloader page.
3) Wouter's Wloader: http://www.voti.nl/wloader/index_1.html
4) Wouter's ZPL: http://www.circuitcellar.com/flash2002/honorable.htm
5) Jolt: http://mdubuc.freeshell.org/Jolt
6) Hitech PIC16F/18F bootloader
http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/26726/an/0/page/0#Post26726
7. Colt bootloader: http://mdubuc.freeshell.org/Colt/
8. Bloader and Screamer: http://www.sparkfun.com/commerce/hdr.php?p=tutorials
9. Free USB bootloader (with encription support)
http://www.diolan.com/pic/bootloader.html
10. Serial Wombat's boot-loader for 18F4620 (with encription) is available for free here:

http://forum.microchip.com/tm.aspx?m=126770

11. Philip Pemberton's PIC18F bootloader
http://www.philpem.me.uk/elec/pic/
12. dsPIC30 open source bootloader
http://mrmackey.no-ip.org/elektronik/ds30loader/

There are so many bootloaders. It seems to me AN851 and Tiny Bootloader are the most popular ones for 16F/18F.