Tuesday, April 30, 2013

ProTrack Audible Altimeter Log Data Format


Since I have now, in the last year, moved to nearly exclusively "Smart Phone" for my daily information consumption and logging of events (photos, thoughts, and random musings) I realized that Skydiving was one place that I hadnt yet made much headway in.

I had gone all digital about September last year when I finally got a GoPro2 from Skydive San Diego, and installed Tom Cain's excellent Skydiving Log Book ( also the Facebook Page for Skydive Log Book ) but I still landed on the ground had to run to my car and upload the data into my laptop. Seriously though who leaves a $3,000 USD laptop lying around!

So I started to wonder if I could get my really awesome ProTrack Audible Altimeter log data saved into my phone.

The first step was the Audio Modem (see a future post - but dont hold your breath) to plug into the Cell Phone MIC/EAR jack, and the second step is the interface board to do all that magic (also a future post) and the final step was the ProTrack Audible Altimeter Log Data Format that I needed in order to convert it into something useful for the log book.

If you love skydiving why not love a Larsen & Brusgaard ProTrack?

Larsen & Brusgaard ProTrack - Low Power never looked Sexier!


Monday, August 20, 2012

Fixing Asus Transformer TF101 Black-Screen Issue

Fixing Asus Transformer TF101 Black-Screen Issue


Seems a few folks have suffered from 'black screen' issues on the original ASUS TF101 tablet.  Some of those might be to do with bricking your tablet during a firmware upgrade, but this case it was a drop like a few others I have seen.  Since I bought the thing around a year ago of course I don't have the receipt - more junk just cluttering up the house!  So naturally they wanted around Y30,000 Japanese Yen to fix it - more than I paid in the first place for it I think!

Fix turned out to be easy, however I think the chances of turning your already non-very useful but working tablet into a door stop are pretty good if you have no idea what you are doing or have never done this before.


Remove screws at the bottom of the tablet, then VERY CAREFULLY 
 push the bevel forward and out and it will easily snap off.



 If any step is going to be the end of your tablet the one above may very well be it.  The bevel's small clips are quite likely to snap so don't force it.  I found inserting thin toothpicks and teasing at it over the space of an hour got me to where I needed to be.  You can see one of those small clips on the bottom left of the screw hole in the photo above.


Remove four corner screws holding on the back plastic cover




Once you unscrew the back plate using the four large screws you will see the Display Cable/Connector (RED ARROW)


Re-seat the display connector sitting under the power connectors from battery. There is some sticky tape holding it all down.
Reverse these steps to fit it all back together and bingo your tablet will either be totally shafted or in spanking new working order like mine.


Friday, August 3, 2012

Disassembling a LeCroy 9400 (125MHz Digital Storage Oscilloscope)

Disassembling a LeCroy 9400

(125MHz Digital Storage Oscilloscope)



The LeCroy 9400 Oscilloscope is now very much a discontinue product but for hobbyists its still a very useful tool.  Originally the scope cost several 1000s of USD, but can be bought for around 200 - 300 USD depending on options.  Modern LeCroy scopes are still available and the cheapest for about 800USD and gets around 500MHz/2Gs and go all the way up to multi-100,000 USD devices and you can find them at their web site.  You can still check out the original brochure for the 9400A (175MHz version of the scope) at this web site.


The LeCroy 9400/9400A can also connect to a GPIB connection for both data acquisition, triggering and general control.  There are many commercial tools and a few free ones such as FCS2 that allows control and capture from Linux.

GPIB cable connected and device ID set to 04 courtesy of Kennel System Blog

Both Kurt and Ko4bb have the manuals and service manuals scanned and online. Below are the ones related to the 9400;
The general operations manual is useful as you might imagine for working out how to do sequential storage, but the service manual is invaluable in showing how to enter the 'hidden' test menu and run various tests to check the failure point in the scope.  It also has schematics so you could feasibly replace most of the scope although I found most common failures were in the two or three custom chips on this scope (HADACC and the HVV200).

Its also a great idea to join the LeCroy mailing list as there are many LeCroy enthusiasts out there that can assist or share stories - its a great little group.

Common Failures

My scope CH2 has failed with a constant 500KHz sine wave and I will discuss swapping the pre-amp boards to fix it below.  It would show a 500KHz sine wave which was always scaled to the voltage level selected.  This hinted that it wasn't the input stage, and more likely the pre-amp board.


First lets look at common failures that others have had with their scopes.  Another Japanese LeCroy enthusiast had similar problems to the one my scope had, in his case CH1 had a sine wave wobble.



Left; Swapping parts to repair pre-amp issues. Right; Pre-Amp board courtesy of Kennel System Blog



Another issue that appears to be possible with the scope is that the pre-amp boards can over-heat if the heat sink isnt attached properly then it can crack and start smoking like this guy shows.

Cracked HADACC chip courtesy of Magic Blue Smoke blog
Another source of issues is the input stage near the BNC which means completely disassembling the scope which can be a real pain.  This could be due to relay failure, or the gain amplifiers on the main board like shown below.

HVV200 or Relay failure photo courtesy of Antique Radiosforum



Disassembling the LeCroy 9400

[ WARNING: Very high voltages 110 - 240V from the socket, and 40Kv from the CRT ]

As above my scope's CH2 has failed with a constant 500KHz sine wave which was always scaled to the voltage level selected.  So, given the common failures I saw with other scopes then this hinted that it was not the input stage and was more likely the pre-amp board.

Remove the upper casing screws







Remove upper case from middle on both side evenly


Remove screws from cross-board connector



Remove screws from Securing Bar
Boards being secured by Securing Bar


Remove screws from PSU back plane and Securing Bar

 
Remove Securing Bar
At this point it should be possible to swap the CRT board, tune the focus and intensity of the CRT, swap the GPIB board, pre-amp/capture boards, and trigger boards, as well as change fuses and other settings.

Main Board, CRT or PSU access


Disassembly from here on gets much more challenging, and you might seriously damage your scope and you run the risk of getting a nasty shock if you arent careful.

In order to remove the PSU / Back panel you need to pull out ...the GPIB cables from the GPIB board, RS232 cable from just below the CRT (right) and the Power Connectors as shown.



Remove Feet, this will release the back plate


Not necessary but these screws release the PSU bricks from the back plate (Top and Bottom of grill)


Back Plate, PSU Bricks and PSU Back-Plane shown completely disassembled


A view from back of scope after Back Plate was removed


Another view from back of scope after Back Plate was removed


View from Top
Remove CRT gun controller board






Gun Controller Board Close Up


Remove Cross Card connector


Cross Card Close Up


Remove First board, Starting from Right (GPIB Board)


GPIB Board Close Up
Notice this board has a connector on the top, this actually allowed for the TV trigger option and other options to be fitted to the top of the scope.


Next pop CH1's connector to the main-board (foreground you can see the ribbon cable for the front display)


Close Up of Pre-Amp capture board (Front)


Close Up of Pre-Amp capture board (Back)


Removing CH2, exactly same as CH1


Removing the Trigger Board (Cables are for NEG/POS edge)




View from back once all cards are removed, including CRT control card on right


Main Board view from above


Main Board view of BNC input on left side


Main Board view from below, BNC input on bottom right


View of BNC adjustment screws


View of BNC adjustment screws


View of BNC adjustment screws


Main Board View Bottom from Back of Scope

 In order to fully remove the main board you have to remove the metal blocks and carefully lift he main board.  The reason for this is the riser card near the BNC CH1/CH2 inputs (as seen below on top right of board just above the BNC) and the IC mounted just behind the reference signal connectors. (as seen below just to the right of the CH1/CH2 connectors).

Main Board fully removed from top


BNC close up from top

As you can see the riser card at the top of this photo (slightly blue, sticking up from behind BNC CH1/2 housing), and the IC just behind the two reference-signal connectors both block easy removal of the main board.


Finally all back together and working

 Putting it all back together was a little nerve racking, esp. as I had no ESD strap to ground myself.  Questions were buzzing around my head; would it work, had I broken something, is it so old it just died naturally on the OR table whilst I was working on it???



It powered up and both CH1 and CH2 are now good to go.  You might notice some roll off/on of the reference signal and this is to do with the probe not being correctly matched but its enough for testing.




Friday, July 20, 2012

Make Your Own IrDA device

Making Your Own IrDA device


I have some old cell phones, PDAs and other whatnots kicking about.  So here I am working on IrDA today as its almost impossible to find a PC with it built in like it was in the '90s or you have to buy an expensive USB dongle!

One could take the easy route and buy a all-in-one module that does it all like the one below or you could fashion your own one from discrete parts.  Guess which route I am taking?

Its going to be exactly the same, with possibly the addition of noise because anything you make yourself is going to be a lot bigger than the all-in-one modules.  However making it myself gives me the ability to choose light wavelength, response frequency of the signal as well as decoding signals that are maybe not even IrDA signals (remote controls for TVs, other beamed data, etc ).  I havent explored the converse - tasking the all-in-one modules as an IR remote.

Courtesy of DigiKey - [ ZHX1820 @ Digikey ]

I managed to get the slowest protocol, at around 9.6KHz, working with little trouble.  However, I am finding it hard to find a photodiode, or photo transistor that meets the speeds and that is at a reasonable price for the faster protocols that run at 100KHz ~ 4MHz so I may come back to the all-in-one device later.

Photo diodes such as the Vishay BPW34 will run at 100ns rise/fall times, these cost around $1.00 each so a bit little expensive when you consider its also going to need capacitors, resistors, amplifiers and so on hooked onto it (see the making section below).
Courtesy of DigiKey - Vishay BPW34 @ DigiKey

Beyond these there are newer standards that I have never seen and these achieve 16Mbps, 96Mbps, and somewhere in the GigaHertz range and I think signal noise is going to become a large part of making these things using discrete components myself.  Certianly prototyping it on bread board is proabably going to go out the window pretty quickly!

IrDA is built around layerd protocols.  It starts at the physical layer that described, well, the pysical aspects of the data transmission.  Infra-red light, at a certain speed, the angle and distance you can 'see' it from and so on.    Then it moves to a layer that negotiates the 'link' or basically how two devices communicate with each other, finding new devices, and negotiating speeds for transfer.  Then above that is the 'management' of the data which basically says how the data is to be split up and maybe shared in different virtual channels (for example maybe sharing data between two applications).  Beyond the 'management' layer are a many number of layers that can connect to the manager and ask for data - the one I am interested in is IrCOMM which simulates a good old serial port and lets me send text to my remote partner.

Courtesy of Wiki - IrDA Protocol Layers



Physical Layer (IrPHY)

As the IrDA standard progressed the IrPHY saw many changes so there are at least 3 common speeds in the physical layer;  SIR (Serial/Slow IR), MIR (Medium IR), FIR (Fast IR) and somtimes VFIR (Very Fast IR).

SIR is 2400bps - 115.2Kbps, the light pulses are 3/16s of the entire bit width long - if you are running at 9600bps then your one-bit-width is 1/9600th of a second or 0.00014seconds (0.14ms, 104us), if you are runing at the fastest 115.2Kbps then you need 1/115.2K which is about 8.7uS.  So now you see the needs for photo sensors that have pretty quick rise times.

The format of SIR pulses are basically a Start bit (light on) to let you know things are starting, 8 data bits (no light pulse=1, light pulse=0) and then a stop bit that is no light pulse but for the length of an entire bit.  This makes it very easy to find the next data, or to wander off and get the timing wrong! 

Negotiation for a new device to the party always starts at 9600bps SIR, so all devices MUST support this speed but they can then negotiate from there to go slower or faster.

SIR @ 115.2Kbps
MIR then is the next speed bump up, running at 0.576mbps - 1.152mbps.  The pulses are the same format as SIR but now 1/4 of the entire bit width.

FIR then switches to 4Mbps and a new pulse encoding scheme called HDLC.  These are small 4-bit chunks of light pulses, the format of the data is such that the pulses cant be confused as at these speeds noise and also power-drop becomes more of a challenge.

VFIR is then just a 16Mbps version of FIR, and they go beyond this but I have never seen any of these in real life.


The Link Protocol Layer (IrLAP)


For SIR and MIR the link discovery, and negotiation is very simple.  Keep in mind, though, that IrDA is actually intended to allow many devices to be talking to a host (for example lots of phones talking to a printer).   So it can become complex but for my needs I am going to just pick a 1-to-1 situation to simplify things.

An IrLAP host begins with a 'preable' to let everyone know its 'sniffing' for new devices.  As you can see in the picture above it sends lots of pulses, then takes a pause.    As you can see its 7 pulses to be exact; Start x 1, 0-bit x 6, 1-bit x 2 and a Stop x 1.    Why seven?   In terms of the PhotoDiode flashing this would look like ON x1, ON x 6, and then a long OFF (1-bit x2, and an OFF) and so you see the 7 pulses since photo diodes dont response to "no light".

In terms of data this is 00000011, but since the first bit you get is the highest order digit (MSb) then the actual pattern is the reverse of this; 11000000.  In Hex this is 0xC0.  This is significant at this is the BOF (start of a IrLAP frame value).

For the device discovery 'sniffing' stage you are goint to see 10 of these, then one more that either is a 0xC0 or an 0xFF and after this you get the following;
  [ address |  command nr |  format ID | various data related to the format id | CRC | EOF ]

The address is going to be 0xFE+1 (1=command, and 0xFE means its a broadcast to everyone.)
The command number is always going to be 0x3F, "Discovery" mode command
The format ID is always going to be 0x01 (discovery information)
The format ID data will always be HOST Addres/ DEST 0xFFFF (broadcast) / Discovery=1 / Slot=1,2,3,4 /  Version = 0 / CRC1 / CRC2 / EOF (0xC1)

These packets are repeated at a frequent interval until a response is seen.

There isnt much more reason to go deeply into the reply as there already is JIR, a Java Lite IR protocol stack on source forge and as long as you can see the first packet you can then hook up your microcontroller to JIR or a C/C++ port of JIR and go!

Implementing an IrDA transmitter/decoder diode set

Getting the final circuit to work was a struggle, this was to do with the Vishay BPW34 actually having a nasty frequency response at lower voltages with at least 10V being needed to 'see' 115Kbps.  What I saw was most of my pulses were being 'glued' together as if being saturated out.  I speculate the diode was acting as a sort of capacitor and holding onto its ON state, not discharging quick enough before the next light pulse came along again to turn it on.

I hooked it up seperately to a 9V battery (6LR61) and got a lovely wave.  Not much use as my microcontroller runs on 3V ~ 5V.  I could 'step-down' the voltage but thats more complexity.

I then moved to a BPW85 which works at 5V and thinks were much better as my micro-controller is a 3.3 - 5v device.

Implementing the IrDA serial light pulse decoder

You can either implement this yourself through a counter scheme using something like the pseudo code below OR you can use a ready made chip such as the HSDL-7002 from Lite-On (SPI signal from your Microcontroller) or the MCP2122 from Microchip (UART signal from your Microcontroller).

.. To Be Continues