Sunday, January 20, 2008

WinUSB Examples

I was looking for WinUSB examples all over the Internet last time but to no avail.

The only one I got is an incomplete example from Microsoft.

Luckily some Microchip Forum posters have come out examples for Visual C++.Net and Visual C#.

Mike Zoran's USB Soundcard and RFModem examples include Visual C++.Net based host software to update the firmware inside PIC18F2550.

J1M has examples for Visual C#.

Tuesday, January 15, 2008

MCU Vendor Ranks and Internet Profile

Often we will judge the popularity of Microcontrollers according to how popular they are on the internet. However this impression may not correlate well with the market ranks.

For example, the top 10 MCU vendors according to iSuppli are listed below (year 2006).
1. Renesas Technology
2. Freescale Semiconductor
3. NEC Electronics
4. Infineon Technologies
5. Toshiba
6. Microchip Technology
7. Matsushita Electric
8. Fujitsu
9. Atmel
10 Texas Instruments.

Of the 10 vendors, Freescale (HC08, HC12, 68k, ColdFire), Microchip (PIC, dsPIC), Ateml (AVR, ARM, AVR32) and TI (MSP430) are very popular from the amount of 3rd Party Internet resources. Interestingly they are all US companies. And I like to use them since they have relatively good documentations and many examples on the Internet. Better sampling policy may also contribute to their popularity. However, in reality, Japanese companies are very strong in MCU market as well. Now it seems that they are beefing up the documentation and start to offer cheaper development tools. Renesas is particularly getting better now.

With the top 10 companies, apparently Microchip is one of the smaller company in terms of turnover. But they are good at concentrating on their core competency (8bit) and branch into 16bit and lower end DSP market. Compared to a few year ago, the growth of Microchip is very remarkable. Maybe Japanese vendors should learn from Microchip by providing cheap development tools and easy sampling.

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

2. PIClist

3. For Open Source PIC development tools under Linux or Windows: GNUPIC

4. For PICkit 2 under Linux

Monday, January 7, 2008

2GB RAM Makes Vista Happy

Yesterday I went to Funan Digital Life Mall, one of the leading IT shopping center in Singapore along with Sim Lim Square.

One interesting thing is that many shops are offering free upgrade to 2GB RAM for Vista notebooks. This is a good thing. Vista is not bad but putting Vista to a lowly configured notebook is not going to give the users a good experience. I played with some of them and I think 2GB will make Vista happy. Another good think is that I see that most of the Vista notebooks come with Vista Home Premium or Vista Business. No more Vista Home Basic.

I also played with Asus Eee PC a bit. Its response was ok and the underline Linux OS was not bad. But I do not think I will like the small keyboard and I am not a mobile worker. So it is not for me. Its price is also not low compared to some low end full notebook. But I understand it is targeting a different group of users. Comparable ultra-portable notebooks from Sony and other vendors are quite expensive.

Friday, January 4, 2008

Interesting blog post: Distro hopping all the way back to Windows XP

The following is an interesting blog about Linux distros versus Windows XP.

I think his experiences can be quite typical for many experienced Windows power users. Interestingly I have some similar experiences with him on some of the Linux distros.

Kubuntu is really not good and it is said that Kubuntu 8.04 will not be an LTS version and I think it will remain a second class citizen in Ubuntu family of Linux. KDE is not really the problem as under PCLinuxOS 2007 it works fine for me. It is the KDE part of Ubuntu which sucks. Firefox under Linux is really not so good (interestingly I also have an ATI card). Mandriva 2008 refused to start X from the CD. So it may be really ATI card sucks under Linux. My OpenSuse experience is not as bad as the author but it is really slow (Gnome or KDE) even though it seems smooth. Linux updating can be a daunting tasks without a fast mirror. Luckily I have a 8Mbps cable modem connection. The speed was 6Mbps in 2007 but the ISP Starhub has since upgraded it to 8Mbps. My PCLinuxOS experience is in general positive but I have some reservation about RPM since once it failed to update some package due to conflict but later it was solved.

So far I have best lucks with Ubuntu 6.06/7.04. Ubuntu 7.10 initially did not run well because of my experiment with Compiz/Xgl which caused the system to be unstable. After removing Compiz/Xgl and going back to the open source ATI driver, Ubuntu 7.10 now works fine. I am not so sure why the author does not want to try out Ubuntu. It is quite good for the transition from Windows to Linux due to easy of use. I was trying out different distros before 2005 and had never really used Linux as the main OS at home. However once I installed Ubuntu 5.04 I am kind of hooked. Linux has been the main OS at home for me after Ubuntu 6.06 came out even though I still keep Windows XP and use it from time to time.

Apparently the author is an experienced Windows XP user since he is an IT professional. Windows XP SP2 is really quite good for experienced Windows user who is careful about protecting the system against virus/malware. I am also an experienced Windows user since 1997 (Windows 95 OSR2) and I have positive experience with Windows 95 OSR2, Windows 98SE and Windows XP SP2. Microsoft seems to do well in the third version. ;-) My limited Vista experience shows that Vista is actually not bad. My wife is now happily using the Vista notebook. But it will take Vista SP1 to get Vista more smooth for most users and for more business to adopt Vista (just like Windows XP SP1). It will take Vista SP2 to finally beat Windows XP SP3 (last SP for Windows XP).

For business users, XP is clearly dominant due to the fact many software packages are Windows only and many organizations standardized on Microsoft Office. The supported version of Linux desktop versions (Redhat/Novell) are not cheap at all.

One thing XP is better than Linux for home users is the driver support. It is not a fault for Linux but rather reflect the reality that XP is the main supported platform for peripheral vendors. Modern Linux distros actually support more device right out of the box than Windows XP. But there are some vendors who do not provide information to the Linux community so that driver is not so easy to be developed.

For home users, the other thing XP is better is that it has a better software ecosystem for many small ISVs. Those ISVs can survive under Windows world since they have the expertise and the market for them. Under Linux, they have to compete with free softwares in a small market. It is hard to imagine that small ISVs can develop a Winzip like utility and expect to earn money for Linux. Major Linux players earn money by offering support/subscription (IBM, Redhat, Novell, etc) or offer big and unique applications (Oracle, SAP, etc).

XP is also better for gamers. It is also better for hobbyists and SOHO developers of electronics because of the existence of free or low cost tool chains (IDE, compilers, debuggers, EDA). Linux has a long way to go in this front.

That being said, Linux is actually good for software developers like the author of that blog post. It is also good for home use (browsing Internet with Firefox, word processing with OpenOffice, etc). It is especially good for people who are not so good at protecting XP against virus/spyware and have simple usage pattens which are in general well supported by modern Linux distros.

The world needs more choices, so we need alternative operating systems like Linux and Mac OS X and others. We also need alternative office packages like OpenOffice which is really good enough for most users. Will Linux dominate the world any time soon? I do not think so. Will Linux get more and more stronger? I think so. Will OpenOffice beat MS Office anytime soon? I do not think so. Will OpenOffice gain more popularity? I think so. OpenOffice/Firefox will actually be popular for Windows user as well due to the high price for MS Office and problems with IE6/IE7.

The best is to try out both world and enjoy the good/bad of both world. Windows and Linux both have its strong point and weak point. Both can exist nicely with each other.

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).
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.

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.

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).

Nice Industrial Ethernet Blog from Lynn Linse

I just came across this very nice website of Lynn Linse who is an expert in Industrail Automation Protocols.

Main site:

Wednesday, January 2, 2008

Google Page Created

Long time ago (back in 1997), I learned some HTML and created a simple homepage (initially hosted in NTU and later hosted in Geocities. However, after some time, I got not much time to maintain the page and it is gone now. And I almost forgot how to write HTML. Interestingly, somebody used my original website as a template to create the homepage for my Master of Engineering supervisor Dr Luo. One of the page got left over. Those links are mostly dead now.

Now I just created an empty Google Page and hopefully I can pick up HTML again. At the same time, I also created a (again empty) Google code page called picusb:

libusb Project Got a New Leader


libusb project just got a new leader. Daniel Drake will take over the task from Johannes Erdfelt. He will continue the maintenance of libusb 0.1 stable branch. He will put his main efforts to the 1.0 development branch. Hopefully this will speed up the development of libusb 1.0 branch.

Tuesday, January 1, 2008

Debian 4.0 Etch

I am basically a Ubuntu user. Since Ubuntu is based on Debian, I've tried to install Debian Etch from the 4.0r1 single Gnome CD but somehow it refused to boot and this only happens to Debian.

Since I've tried the Ubuntu 6.10/7.04 Installation from Ubuntu 6.06,
(, I managed to install Debian Etch from Ubuntu 6.06 using the same method. One thing I need to mention is that I need to manually set up the timezone by changing the file /etc//default/rcS (UTC=no instead of the original UTC=yes).

Debian Etch (current stable) is said to be very stable and so far it works fine for me except one thing. I am not able to use Swiftfox or Mozilla Firefox to replace the stock Iceweasel (at Stock Firefox under Ubuntu versions are not so stable with my desktop (NForce 3 motherboard with ATI9800SE AGP graphics card, AMD64 3000+ CPU, 1GB DDR RAM). Most likely it is a problem with the Xorg X server and Ubuntu version of Firefox. And this happens to Debian as well: it sometims crashes without warning. Swiftfox in general works better for me. Somehow even after I uninstalled Iceweasel and remove all things Iceweasel related, when I run Swiftfox or Firefox from Mozilla and check the version, it always shows Iceweasel I am not so sure why. Hopefully I can figure it out in the near future.

Edit three hours after posting:
After enable the security updating, now it is at and hopefully this will be better than the old And I can install Swiftfox (the default version of 3.0b3-pre3 is not usable but the older version is ok). I can also run the original Mozilla Firefox

One more problem is that the flash plugin does not work under Opera. I installed Opera before I found the solution to the above-mentioned problem.