sabato 15 giugno 2013

LOW PIN COUNT USB compatible board

Here I am again! this time I'll show you how to build a USB demoboard like the Microchip USB LOW PIN COUNT... save your money, DIY!











It's an easier board with respect to this http://ferretrobotics.blogspot.it/2013/05/picdem-fs-usb-compatible-board.html, but it is cheaper too!

if you are asking why build this board, the answer is simple: the 18F15K50 PIC is a cheap microcontroller (lot cheaper than the most famous 18F4550), and the instructions you can find on the Microchip site (http://ww1.microchip.com/downloads/en/DeviceDoc/41356B.pdf) are really reliable. So if you would like to enter the fantastic world of the USB driver developing, this is the right choice (IMHO) ;)

first of all, this is the "real" board http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en536385.
I've never seen it for real, but I guess that is a little bigger than mine.

actually the only thing hard here is to develop che board from the schematics (which are present on the datasheet from Microchip). So you guys are lucky because I did all the work :p

here you can find the Eagle schematic and the .brd file: https://sourceforge.net/projects/lowpincount/files/schematics%20and%20board/
ONE IMPORTANT THING: for some misterious reason, the Microchip engineers used a MALE DB9 port on the pcb, so I did the same. If you want to use a female port, you must switch pin 2 and 3 on the board. Otherwise, you will end up building a null-modem like adapter, but female-female. Anyway, i think nobody will use the rs232 anymore, maybe for some microchip example.

It's a double-face SMD pcb, so it's not very easy to build, but if you don't try you'll never learn! so here some pics of my work... (yes, I signed the board XD)




so, this was how it looks like... but how does it work?
for more information, refer to the microchip specifications, but if you just want to know if the board works, this is what you need (you can find a copy of the most important files on the sourceforge page of the project https://sourceforge.net/projects/lowpincount/files/):
  • a pic programmer: I'm gonna use a Microchip PicKit 2.
  • a software for pic programming: I'm gonna use PicKit 2 software, at the moment the latest version is  2.61. Remember to upgrade the device file, otherwise the pic 18F14K50 will be an "unknow part".
  • Microchip Application Libraries installed (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en547784) at the moment latest version is v2013-02-15.
  • the bootloader, normally located in microchip_solutions_v2013-02-15/USB/Device - Bootloaders/HID/USB Device - HID - HID Bootloader - C18 - PIC18F45K50.hex.
  • the application to upload a firmware using the bootloader, again you can find it here  https://sourceforge.net/projects/lowpincount/
  • an hex file to upload... like the basic example. If you don't use a precompiled version of the firmware, remember to use a linker script to not overwrite the bootloder.

step-by-step instructions:

upload the bootloader using the PicKit 2...


populate the jumper to power the pic from the usb cable

press the button and connect the board using an usb cable or directly into the usb port


run the HID bootloader software from Microchip (normally located in microchip_solutions_v2013-02-15/USB/Device - Bootloaders/HID/)

click open, select an hex file, for example USB Device - CDC - Basic Demo -  C18 - Low Pin Count USB Development Kit.hex located in \microchip_solutions_v2013-02-15\USB\Precompiled Demos\Low Pin Count USB Dev Kit PIC18F14K50 and then program and reset the device...

the led on the board should now starts bliking... unplug and re-plug the board, and using a terminal type something


 Oh, since the demo is built to add 1 to the ascii value typed, this is "hello world!" ;)

that's all :)

Nessun commento:

Posta un commento