Tag: usb

VEHO USB mikroskop

Za neke pristojno male pare kupih neki dan u Ugarskoj (neka firma u Budimpesti prodaje gadgete za PC, ne znam da li bi nasao ponovo) VEHO DISCOVERY VMS 004 DELUXE. Pristojno male pare znaci da me je izasao oko sto nemackih dinara, isti taj mikroskop je dostupan sa drugih mesta za manje pare, ali je problem sto niko nije hteo da mi ga posalje za Beograd, pa sam morao da idem skupljom varijantom i kupim ga u radnji. Ima ga i na .com-u zavisno dal vise volite da placate u funtama ili dolarima…

Sprava radi odlicno. Prva bitna stvar za znati pre kupovine ovakve naprave je to da 20-400x ne znaci da ima uvecanje od 20 do 400 puta vec da ima uvecanje 20x i da ima uvecanje 400x – nista izmedju.

ovako izgleda 20x FTDI chip na plocici:

FTDI 2232HL i kondenzator (2x1mm) 20x uvecanje

FTDI 2232HL i kondenzator (2x1mm) 20x uvecanje

Kada se prebacimo na 400x i slikamo pin i viu koja se vidi na cetvorci od C4 to izgleda ovako:

FTDI 2232HL pin and via (400x uvecanje)

FTDI 2232HL pin and via (400x uvecanje)

 

I ako se pomerimo za pola pina gore i malo desno, vidimo ovaj pin sa slike i pin iznad njega:

400x uvecanje 2 pina na 2232HL

400x uvecanje 2 pina na 2232HL

Kao sto se da videti 400x ima vrlo mali depth of field i dobar je za pregledanje kvaliteta spojeva dok 20x ima dovoljan depth of field za normalan rad. Takodje 400x slike su slikane tako sto mikroskop skoro dodiruje pcb dok za 20x slike izmedju mikroskopa i pcb-a ima dovoljno mesta za ok rad lemilicom.

 

Druga znacajna stvar kod kupovine ove sprave je da postoje 2 verzije 004D, jedna ima tocak za promenu jacine svetla (mikroskop ima 4 bele ledare koje osvetljavaju snimani objekat) a druga nema. Verzija koja nema tocak za promenu intenziteta svetla nije kompatibilna sa mac snow leaopard osx i nije kompatibilna sa win7, verzija koja ima tocak za promenu intenziteta je kompatibilna i sa sneznim i sa win7.

Stalak koji dolazi uz spravu je lep ali nije bas stabilan (fali mu tezina u “stopi”) tako da cete ga ili lepiti za podlogu ili necim otezati stopicu (nije problen nataknuti na nju nekoliko velikih matica i resen problem)

Sve u svemu, za te pare, odlicna sprava

 

Tags: ,

Open Source CDC USB Stack for PIC

Community gathered around Dangerous Prototypes site decided that it is time we have a decent USB stack for Microchip PIC micro controllers that has usable open source licence. The USB stack provided by Microchip as part of the MAL is great, works perfectly but has a huge flaw, and that is, it does not allow you to properly use it with open source projects. When you have your open source project that uses MAL you share your project on some public CVS/SVN/BZR/GIT.. repository but you have to remove all MAL files and add a readme to explain to users how to download mal, how to install it, where to put it etc … and it all makes a huge mess and is very unreliable. The worse part is that Microchip from time to time decides to make incompatible changes in the MAL so that your old code don’t work with new version of MAL. Of course Microchip don’t keep archive of old MAL releases so if you find open source project that is not using up to date version of MAL you can only cry as there’s no way you can get the same MAL developer of the project uses….

This brings us to the new open source stack being developed by the Dangerous Prototype community, namely Honken and JTR with help from everyone else. You can follow the progress on the Dangerous Prototype forum.

At the moment USB stack support only CDC, but hopefully soon we will have HID and some other profiles too. The latest version of CDC stack in form of simple echo application is available on the forum. I modified it a bit to work with 18F2550 and hid bootloader (this one is microchip’s) and you can find hid bootloader in my previous post where you can find bot HEX of the bootloader and the source for linux app to use it. The modified project for MPLAB.X that creates simple USB CDC device that echo back what you send it can be downloaded from here.

The example showing 18F2550 enumerate:

Mar 15 06:45:15 luckey kernel: [ 6694.873125] usb 5-2: new full speed USB device using uhci_hcd and address 8
Mar 15 06:45:15 luckey kernel: [ 6695.053649] usb 5-2: New USB device found, idVendor=04d8, idProduct=000a
Mar 15 06:45:15 luckey kernel: [ 6695.053653] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 15 06:45:15 luckey kernel: [ 6695.053655] usb 5-2: Product: CDC Test
Mar 15 06:45:15 luckey kernel: [ 6695.053657] usb 5-2: Manufacturer: Dangerous Prototypes
Mar 15 06:45:15 luckey kernel: [ 6695.053659] usb 5-2: SerialNumber: 00000001
Mar 15 06:45:15 luckey kernel: [ 6695.055690] cdc_acm 5-2:1.0: This device cannot do calls on its own. It is not a modem.
Mar 15 06:45:15 luckey kernel: [ 6695.055706] cdc_acm 5-2:1.0: ttyACM0: USB ACM device

Tags: , , ,

Microchip Application Libraries include pretty good HID Bootloader made by Microchip developers. It is fairly small and works even on small devices like 18F2550. Microchip also (inside the MAL) provides the application to upload HEX files to the microcontroller using bootloader. This is all nice and all works good, except that if you don’t have windows there is not much you can do with the hid bootloader as there is no linux version.

As I use Linux only (64bit Fedora Linux – currently v10 and v14 are used in my home) I decided to rewrite the bootloader code to work on Linux. I managed to get it working inside few hours. It is just a small shell application that you run passing it single parameter (your hex file), it will erase mcu and upload hex. It uses libusb-1.0 library and the project is using CMAKE (kdevelop4 is used as IDE).

You can download source code (and linux 64bit binary) of desktop application to upload firmware using hid bootloader here

[[email protected] build]$ ./hid_bootloader ../cdc.hex
nasao
Family: PIC18
ERASED
PROGRAMMED
[[email protected] build]$

If you use PIC18F2550 here you can download HEX file with the boot loader firmware. Note that I changed default behaviour of the boot loader so now you enter boot loader if PGC and PGD are connected instead by tying B4 to the Vss. I did this because all my boards have ICSP connector on them so it is easier to add a jumper over PGC/PGD then to waste a B4 pin to boot loader.

Tags: , , ,
Back to top