Make: My first USB device

Page 1

GIVE WINDOWS A HUGE BOOST! P54

FREE DVD 56 GAMES

ISSUE 230 SEP 2009

PERFORMANCE GEAR & GAMING

ISSUE 230 IT CAN’T RAIN ALL THE TIME

IT CAN’T RAIN ALL THE TIME

AMD: still best for budget gaming?

“A BRUTAL CROSS BETWEEN DIABLO AND ROGER RABBIT”

Dave loots and shoots in Borderlands

Pixel-perfect shooters 12 gaming mice in the labs

WWW.PCFORMAT.CO.UK

THERE’S MORE… Gigabyte: behind the scenes Core i5 specs revealed Real Time Strategy classics!

Men Warof ARMA 2: WAR HAS NEVER FELT SO REAL

PCF230.cover 1

HOTWIRED! GET MORE FROM YOU RIG

¤ DIY WATER COOLING ¤ MAKE A CASE SENSOR ¤ CORE i7 OVERCLOCKING

EVEN MORE…

NOVATECH X90 GTX PRO MESH SLAYER PC COOLIT DOMINO ASUS XONAR DS PROTOTYPE: UNLOCK ZOTAC ION MOBO TRINE, ANNO 1404 GENETIC SHACKLES

Issue 230 Sep 2009 £5.99 Outside UK & ROI £6.49

15/7/09 10:10:25 am


Make: My first USB device Hold on to your breadboards, we’re going to try and make a fully working USB device. We’re a little scared…

W

hile we regularly like to disembowel, disassemble, disfigure and generally ‘dis’ USB devices in all of their forms, it’s always either standing on the shoulders of the geniuses that made the device in the first place, or at least leaning on the fact that the USB interface offers a handy 5v supply. We’d never pretend to be electrical engineering experts or even acolytes. But, for once, we’re going to stick out our necks a little and attempt to put together a fully functioning USB device. This borrows heavily from clever people online and is based around a more advanced ‘PIC’ device. These are simple programmable processors produced by a company called Microchip Technology (www.microchip.com). Over 6 billion of these bad boys have been shipped in their time and, costing as little as 50p for the basic models, they’ve been rather popular with hobbyists. Coming with their own

onboard flash memory and boasting easy-to-use interfaces, they can be turned to a host of applications. Before you can use a PIC it needs to be properly programmed. This involves loading it with a program from your PC. Programmers are available on eBay for as little as £10, but if you buy one make sure it’s compatible with the model of PIC that you want to use. In our case, that’s the 18F2550. It’s a more advanced PIC and so is less widely supported than the default PIC16 models. ¤ Neil Mohr

Costs

£25

What you will need

¤ PIC programmer ¤ PIC 18F2550 MCU ¤ 20MHz crystal clock ¤ Breadboard ¤ PCB USB B-type socket ¤ 1x 0.22uf capacitors ¤ 2x 22pf capacitors ¤ 1x 0.1uf capacitors ¤ 1x LED ¤ 1x 330ohm resistor

1 4

2

3

Future Publishing Limited provides the information for this project in good faith and makes no representations as to its completeness or accuracy. Individuals carrying out the instructions in this project do so at their own risk and must exercise their independent judgment in determining the appropriateness of parts, equipment, sealants and other

64

PCF230.make 64

adhesives for a particular use. (Yes, we know, but it’s what the lawyers tell us to print). Protective clothing, gloves and goggles/safety glasses should also be worn at all times, when using drills and soldering irons. Use of the USB device may void a product’s warranty (like you really care, but, again, we have to say this for the stupid people). To the fullest

extent permitted by law, Future Publishing Limited takes no responsibility for any person relying on the information relating to this project and disclaims all liability for any errors, omissions, damage or injury to users or their equipment as a result of or relating to their making and use of the USB device.

September 2009

16/7/09 8:21:31 am


Make: My first USB device 5 6

7

“Over 6 billion of these bad boys have been shipped in their time and they’re popular with hobbyists”

9

8

How to program your PIC

10

Every PIC programmer is different – some are USB, some are serial, others are standalone. Either way, you need to program the PIC with a USB firmware. From www.schmalzhaus.com/UBW/ index.html grab the Firmware D v1.4.3 HEX file, near the bottom under the files section (1). Looking at the USB B female socket’s terminals with the connection pointing left. The top left pin is the ground terminal, to the right of this is the 5V positive terminal. Bottom left is the positive data terminal and right of this is the negative data terminal (2). The 20MHz clock crystal connects to pins 9 and 10; there’s no polarity so either terminal will do. Each terminal also requires a 22pf capacitor connecting to the USB ground terminal (3). It’s best if you connect the USB ground to its own strip as this is used a lot. For instance, connect the 0.22uf

capacitor from pin 14 to the USB ground for the USB voltage regulator (4). Connect the USB positive data terminal to pin 16 and the negative data terminal to pin 15 (5). Pin 8 and pin 19 of the PIC both connect to the USB ground. Pin 20 connects to the USB positive power terminal (6). It’s worthwhile placing a 0.2uf capacitor across the power pins 19 and 20. This helps eliminate any spikes in the supply (7). From Pin 26, connect the 330ohm resistor and the status LED to the USB ground (8). Download and install the driver from tinyurl. com/5dbco2. When you plug in the device, choose to manually install the driver from C:\MCHPFSUSB\fw\Cdc\ inf\win2k_xp_vista32_64 (9). This base USB device is the gateway to a host of projects, such as can be found at www. semifluid.com/?cat=9 or search Google for 18F2550 for more things to try (10). September 2009

PCF230.make 65

65

16/7/09 8:21:34 am


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.