Showing posts with label DSO. Show all posts
Showing posts with label DSO. Show all posts

Sunday, February 14, 2010

Touch Me Please!

Before I dive into this post I take a moment to profusely apologize for the title of the post – it is tragically horrendous.

OK, so now that I’ve got that out of the way, lemme begin. This post is a little out of ‘order’; it would have been more appropriate had I first blogged about how I procured some of the components mentioned in this post. But heck! Lazy as I am, I guess I’ll leave that for a later date.

A friend of mine (un)fortunately busted his laptop several months back. I managed to persuade him to let me scavenge parts from the laptop. What parts did I get? That’ll be the subject of a different post :-D I managed to rescue several components; a touchpad being one of them. And as usual, I went about trying to interface it.

Electronics being my love, and today being Valentine’s Day, it is most fitting that I have successfully managed to communicate with the touchpad. Now before you start making judgements about me, and why I fool about with electronics on this most awesome day, let me tell you how I went about the interfacing.

The touchpad is a mouse replacement ubiquitous on laptops. Synaptics is by far, the biggest touchpad manufacturer. Alps Electric, Cypress, and a few others are also into the touchpad market. Most touchpads today work on the principle of capacitive sensing.

The touchpad of my trusty IBM Thinkpad R51 

The touchpad I scavenged was from an HP Pavilion dv2000 series laptop. The touchpad used is probably manufactured by Alps Electric Corporation (there is a prominent “ALPS” silkscreened onto the back of the PCB). The touchpad is a capacitive sensing type and is controlled by a 48 pin QFP. The chip is marked 1CA026A. I googled high and I googled low but I couldn’t find anything useful; no datasheets, nothing. So it became necessary that I give experimentation a shot.

There is a four wire flat cable (FFC) heading off the PCB. Having fooled about with electronics for a while now, I knew that it was but obvious that the touchpad used some sort of serial protocol. I figured that there were a few possibilities – maybe USB, possibly I2C. Again, I googled to see if touchpads followed a standard protocol. Most sites on the net said that laptop touchpads invariably use the PS/2 protocol, however, none of them said it with ‘authority’. It was always “apparently, touchpads use the PS/2 protocol” or “the PS/2 protocol is used even on laptops”.

Anyway, I thought I’d give USB a try. I used a hacked-together USB dev board, pulled out V+, Gnd, D+, D-, and connected them to what seemed like the appropriate pins on the touchpad. When the error “USB device not recognized” popped up, I reversed D+ and D-. After I still got the same error, I guessed that it was the PS/2 protocol that the device used.

I don’t have a PS/2-to-USB converter so I had to use one of my trusty PICs (a ‘628A is this case) to emulate a PS/2 host. I wrote my own driver basing my ‘read data’ code on something written by Dheera Venkatraman (who has very kindly made his code available online).

I also referred to these sites for info about the timing specs of the PS/2 protocol:
http://www.computer-engineering.org/ps2protocol/
http://www.computer-engineering.org/ps2mouse/
http://documentation.renesas.com/eng/products/mpumcu/apn/reu05b0121_h8s2100ap.pdf

 

Below are a few pics that I took.

tpboard bottom
Right: The touchpad; left and right buttons are on the PCB
Left: Bottom view of the touchpad PCB

The test rig 

Initially, when the touchpad is powered up, it sends 0xAA (‘passed self-test’), followed by 0x00 (which is the mouse ID). The ‘628 then sends the byte 0xF4, which tells the touchpad to stream data, i.e. continuously send any activity on the touchpad or the buttons. Once all commands are received/issued the PIC asserts a pin connected to an LED.

Init The initialization sequence – 0xAA(self-test OK) followed by 0x00(Mouse ID)

Here is my code if you need it. While you are free to modify it in any way you wish without permission, it would be nice if you remember to give me credit. :-D

Video to come up shortly.

Friday, January 15, 2010

My First ‘Proper’ T&M Instrument

I haven’t written in AEONS! And I figured, “Hey! What better way to begin my two-zero-one-zero archive than by bragging…..oops!….I mean blogging about one of my new acquisitions”. I’ve recently bought myself a DSO. Not the fancy Agilent or Tektronix scopes; I bought myself something much more affordable – a DSO2090. I’m pleased with it. Very pleased. And, since there are very few reviews about it online, I’ve decided to write one.

I had initially decided to build my own DSO, but as I soon found out, building test and measurement equipment is no child’s play. I tried in vain to get my hands on a decent ‘scope on eBay, but most of the scopes were out of my budget, and the ones that were in, wouldn’t ship to India. A lot of manufacturers make  USB scopes – PicoTech and BitScope being the notable ones. But again, too expensive. And I really got sick of trying to use my soundcard as a low cost ‘scope. So after much forum-trawling and  late night ‘research’ I settled on the DSO2090. Do note that the price of this instrument can vary from 160 bucks to over 300 bucks on the net!

The ‘2090 is a good piece of equipment. It’s priced reasonably well (obviously, a lower price would be better! :-P), and it has most of the functions that higher end DSOs have. A few words of warning – don’t expect the ‘2090 to match up to a dedicated bench DSO. The ‘2090 is more like a tool that the moderate-to-advanced-level hobbyist, rather than a test engineer at Texas Instruments, would have.

1Scope Ripped from the seller’s (www.getbetterlife.com) eBay page 

I still haven’t test driven the socks of the DSO, but I have managed to get my fingertips dirty. Read on for the lowdown.

The ‘2090 is a USB driven, two channel digital signal oscilloscope. Mine is a Hantek clone. It can measure at 100 megasamples per second (MSps), and has a bandwidth of 40MHz (for a nice explanation about the difference between sampling rate and bandwidth go here, and also read this).

Specs:

  • 100MSps real time sampling
  • 2.5GHz equivalent sampling (also called ‘ETS’)
  • 40MHz (-3dB bandwidth)
  • 8 bit resolution
  • Max input voltage 35Vp-p
  • Vertical deflection: 10mV – 5V @ 1x probe (9 steps)
  • Horizontal deflection: 4ns – 1hr (38 steps)
  • Trigger: external, or either channel (edge based, single, normal)

Software features:

  • Several convenient measurements (P-P, frequency, RMS, etc)
  • FFT/Spectrum
  • Math (add, subtract, multiply, divide)
  • Saving screenshots (JPG, BMP
  • Logging (DAT, Word, Excel)
  • Nice demo function
  • Other useful features

I ordered my DSO2090 from a China-based site. The cost was the lowest from among all the web-based dealers, AND more importantly, shipping costs weren’t atrocious. The base price was USD161.20, and shipping was USD29.71, for a total of USD191.91 (~INR 9,324). Customer service on the site was very prompt and courteous. Shipping to Gurgaon, India, took a little long – 10 days. But in all fairness, it was the Christmas week. Packaging was very good, and the DSO came unscratched and unharmed. I had no issues with customs (both Bombay, and Delhi released the parcel in less than 3 hours).

2Packing3Packing
Really good packaging

4Box5Kit
The box, and its contents

The scope is totally USB driven – no external power required. The cable supplied is a USB ‘Y’ type cable – One for power and data (black), and the second (red), to supply additional power, if necessary.

 6Ycable7Front
The ‘Y’ cable to the right and the BNC jacks to the left.

Two BNC clip probes and a few probe accessories come as part of the kit. The probes supplied are compensated 1x/10x probes. Considering the price, they’re very good quality.

8Probes9Probe
Left: The Probes Right: One of the clip probes with its sheath pulled back. Also visible is the 1x/10x slide switch.

 10Probes
Close-up of the probes (from some site). The colour coded rings are really useful.

At the back of the scope there are two metal tabs – “Ground” and “Cal”. The calibration tab gives a 2Vp-p square wave at 1kHz.

 11back12cal
The back of the probe on the right. The probe’s own calibration signal is on the right.

The body of the DSO is plastic, and build quality is fairly good.

As with almost all digital T&M equipment these days, the ‘2090 can be interfaced with custom software. As a bonus, sample C++, VB, and LabVIEW programs are included on the driver CD.

Below are a few screen shots of some measurements.

13noisePower supply noise when my CFL table lamp turns on

14PWM
A 50% 6.13kHz PWM from the Super Probe that I built some time back.

15motor
Brushed motor noise. The BEMF spikes when the brushes break contact are clearly visible. RPM of the motor is approximately 20000 RPM.

What the DSO2090 is NOT:

  • a Tek or an Agilent ‘scope
  • a full-fledged DSO with benchtop features
  • a standalone device
  • a super-accurate device that you can trust your life (or other’s lives) on

What the DSO2090 IS:

  • an awesome hobby ‘scope with lots of features
  • a very low price test and measurement device
  • very portable
  • a very cool device that will enhance your geek image

The final word? If you’re a poor student hobbyist like me, and have reached the stage where you ‘absolutely need’ a way of seeing what signals are zooming around in your circuit, then the DSO2090 is certainly for you. There are variants to the ‘2090:

  • the DSO2150 (150MSps/60MHz)
  • the DSO2250 (250MSps/100MHz)
  • the DSO5200 (200MSps/200MHz)
  • the DSO5200A (250MSps/200MHz)

I find that the ‘2090 is the best value for money, and it fulfils my need, at least for now :-D . A recommended buy for those looking to purchase a ‘scope.

Visitors