Saturday, 22 December 2012

TI Stellaris Launchpad

My Stellaris Launchpad finally arrived the other day. I ordered it back when they were under £4 each several months back. They're now about £10, which still isn't bad.

The example software bundle is over 340MB and requires signing up for an account, along with requesting 'permission' to see the code. The drivers seem to be BSD licensed, but the example programs cannot be redistributed. I also tried to get the popular 'Code Sourcery' GCC compiler they recommend but all I got was login screens and talk of professional versions.

Screw that.

On Github you will find my solution. You can use either the ARM Linux toolchain in the Ubuntu repostories (yes, even for bare-metal programming) or fetch the one built by ARM. No click throughs. No legalese. Just free software. The bits I wrote are even under the MIT license so you can crib away, guilt-free.

So far, the example flashes an LED and changes the colour if you press either of the buttons. I think I'll build up a simple library for GPIO and UART because, you know, that stuff's fun.

Thanks to, and who gave me some great pointers (although I've used the mildly-insane SCons build system rather than the deeply-insane and incomprehensible Make).

Sunday, 11 November 2012

Jaguar / Alpine AJ9500R radio / cassette

There was a slight mistake in the last pinout, which I've now corrected. Looking at other Alpine M-BUS pinouts (search for S601 on this page), it appears to be exactly as per the standard, except they've swapped the central ground pin with the M-BUS data pin. I suppose this is to thwart those trying to add a generic Alpine changer.

While I've got all my electronics stuff over the dining room table, I thought I might take the AJ9500R radio apart and try and find out why it has sporadic memory failures. The symptoms are, no control over volume on power up and, if it's been unplugged, inability to recognise the correct radio code (although when that happens it also doesn't record the incorrect attempts count so you can just power cycle it and try again). I'm guessing this is a failure of the EEPROM memory.

Here's the PCB. The EEPROM is the X24C01 in the centre labelled IC502.

There are datasheets online. I might try and tack on a tiny wire and monitor the I2C interface to see if the chip is returning sensible results or garbage. New ones are available from Farnell.

Sunday, 28 October 2012

Moving in a different direction

I recently purchased a 1995 Jaguar Sovereign (you might know it as a Jaguar XJ, but the Sovereign spec doesn't actually wear an XJ badge anywhere). It has a CD changer in the boot and a radio/cassette in the dash. The radio is rumoured to only accept a specific model of CD changer while using the Alpine M-BUS protocol. What I want to do is build an M-BUS to UART adaptor out of an Arduino, or a TI Stellaris Launchpad (mine's on back order) and use that to control a Raspberry Pi running an MP3 playback daemon. Six disc buttons gives you six playlists and the skip forwards / backwards should be usable too.

While I wait for the Launchpad, I've been putting my Arduino to use trying to probe the data pins, without too much success I might add. What I have managed to do is:
  • Build a 5V switch-mode power supply to turn the car's 12V (or actually 10V to 14V) supply into something the Arduino (and a Raspberry Pi) can handle. I'm using the LM2576 of which I picked up three off eBay at £1.20 each.
  • Power the radio up on the bench, along with the CD changer. The changer gets all its power and data from one 8-pin DIN cable.
  • Probe the 8-pin DIN pinout.
The 8 pin DIN cable has inside, the following colour wires (numbered is as you look at the pins on the male, or the solder buckets on the female):
    • Brown - pins 4 and 5. Always at 0v.
    • Yellow - pin 7. Permanent 12V.
    • Red - pin 6. Switched 12V.
    • Black - pin 8. Always at 0V.
    • Audio Right, Audio Left and Audio Ground in a separate bundle (pins 2, 3 and 1)
I've connected the Arduino to every pin (using a CD4049 hex-inverter / buffer I found in a kit of PSU components) and saw nothing changing. Looking back at the results, I'm wondering if Black is the data bus but that it requires the CD changer to pull it up. What I need to do is wire up the 8 pin plug and an 8 pin socket back to back with a bit of stripboard in the middle so I can sniff what's going on. The trouble is, the 8-pin DIN socket on a flying lead that I bought off eBay is confusing...
  • Pin 6 is blue
  • Pin 7 is red
  • Pin 1 is both black/yellow and black
  • Pin 2 and 3 are yellow and white (audio)
  • Pin 4 is green
  • Pin 5 is brown
  • Pin 8 is n/c
So, I can't use this connector as the pin I suspect Jaguar use M-BUS (pin 8) is n/c and the audio ground (Pin 1) comes out on two separate wires. Removing the back of the connector confirms this - there's nothing connected to pin 8. Still, it looks like I should be able to add an extra wire in to that middle pin if I'm careful.

Friday, 6 July 2012

Pull down

Just as a quick note to myself: the UDN2981 requires pull down resistors as the inputs are not allowed to float when Vcc is powered. A SIP resistor pack should sort that without taking up too much space.

Tuesday, 3 July 2012


It turns out you can get relays from Farnell for about 55p each. You need two SPST relays per point, plus something that can switch the 30mA coil current @ 12V DC. Having played about with PCB schematics and vero-board layouts, I'm starting to think relays would be a more robust option than the L293 drivers. It also frees me up to purchase standard Peco motors rather than the 2A 'E' high-efficiency motors, and reduces concerns with regard to supplying the motors from a capacitor discharge unit. I may even be able to throw two points in a crossover on one output. Whereas the signals are common cathode, the relays are single coils which work in either polarity. As the UDN2981 (8 way high-side switch) and ULN2803 (8 way low-side Darlington array) are largely pin compatible - you just need to switch the GND and 12V over - I can use the cheaper ULN2803 fitted to the signal control boards for controlling the relays, which reduces the BOM by a couple of pounds per board. Then all I need is a board containing the relays (and possible a home made CDU). This board could even be built first and operated with push switches in order to test the points.