Sunday, 22 December 2013

LCD success!

I can now blit coloured rectangles to a small 4" LCD. Bloody /RD (pin E1) was stuck as an output, even though I'm clearly telling it to be an input. This broke the LCD self-init. Why will have to wait for another day - for now, I've unplugged it.

In other news:
  • I can't set optimisations to O2 or O3 without my code crashing on startup. O1 is fine.
  • Function calls appear to be very slow on the LM4F. Inlining a bunch of stuff speeded it up no end.
  • Even with heavy inlining, it's still taking a while to draw the screen. We'll see how it goes when I'm rendering glyphs instead of boxes. Plus, 16 bit mode will help - I'm writing 3 bytes per pixel at the moment.

Friday, 20 December 2013

LCD frustration

So, I've been trying to get this Displaytech LCD module to function, as part of the Mazda's TFT dashboard. Without the aid of a scope or logic analyser, it was extremely difficult to debug the 8-bit parallel (8080 style) interface. So, I've managed to lay my hands on a Salea Logic16 - the most amazing logic analyser I've ever used. The software is just gorgeous, even under Linux. Unhooking my board and connecting the analyser instead, very quickly I was able to determine that the Displaytech module's on-board Atmega is sending valid commands at the panel on startup, configuring it as 480x272 as expected. Because when my Stellaris board comes along and reads out those registers I'm getting absurd values (15 x 793), this means my board is probably pulling a line during the critical startup phase. Next stop - connect it all back together and probe with a scope to find out what I'm doing wrong.

Monday, 30 September 2013

On-board diagnostics

I had a thought and figured I should write it down somewhere. The Jaguar supports OBD-II, as demonstrated by my Scan Gauge II. It's a big ugly having the gauge sat on the centre console by the gear lever, even if it does tidy away neatly into the arm rest when not in use. I'm sure with a an optoisolator like the one going in to the Mazda dashboard, I could knock up an OBD-II reader out of a the Stellaris Launchpad I'm going to use to decode the radio UI. This means I could put real-time stats on the radio UI. You could use the mode button to knock it between FM, DAB, MP3 and use, I don't know, the Dolby button to put it into real-time gauge mode. The skip up/down toggle would switch between PIDs. I did wonder if anyone had done any reverse engineering on the AJ9500R since I last looked about a year ago. Two of the top three entries on Google were written by me. I take that as a no then.

Saturday, 7 September 2013

Stellaris update

I'm about to try and drive a 4.3" Display-Tech LCD from my Cortex-M4 powered Stellaris Launchpad board.

Yes, this is a different LCD to the one I mentioned previously. I bought two 2.8" cheap and nasty eBay specials and one arrived cracked and the other wouldn't respond to some test code using uTFT. I gave up and decided to buy something a little more professional. Sadly, I seem to have bought the last one RS are ever going to stock. I hope I don't break it.

Anyway, in preparation, I've enabled PLL support and added an option to clock the chip at 66.67MHz. I have a feeling that's going to be helpful later on.

See my github.

Sunday, 25 August 2013


There's so much going on at JP Towers that I feel the need to write some of it down,  lest any of it leaks about of my brain.

I've talked about the Jaguar radio upgrade before so that's one.

I'm planning to implement while house temperature monitoring. This will use the cat6 running to (almost) every room and Dallas one-wire temperature sensors. I'll probably drive them as multiple busses using at Arduino as there are issues configuring a star as a single 'bus'. The sensors are in and have been tested on the Arduino,  I just need to build an adapter to connect to my patch panel and build some sensor 'plugs' using standard 8P8C shells.

I've got a new boiler going in soon.  I've selected a Viessmann 200-W a it has an IR control interface.  This will allow me to disable the heating when we're out and restart it on our journey home using my phone. I can probably use the Arduino for this as well as it'll be in roughly the right location anyway.

My brother has fitted a quad-cam Lexus V8 (1UZ-FE) to his Mazda Bongo camper to replace the broken 2.5 diesel. Mechanically it is all fine but issues with the dash and the speed / RPM pickups mean we probably can't use the old dash clocks unchanged. The Lexus tacho needle driver will fit but the frequency of the input needs adjusting to get the numbers correct. For the speedo we've decided it'll simply be easier to fit a TFT where the speedo was and use a Stellaris Launchpad to output speed and odo/trip on the LCD. I did order a couple of cheap TFT modules off eBay - 2.8" units with an ILI 9325 driver and an SD card slot -but one was cracked in transit and neither appear to work at all. RS have something similar,  but a bit bigger, so I'll give those a try. I also need to build a circuit to interface the micro with the 12v logic used by the Lexus electrics, but I'm hopeful I can use a standard USB PSU.

Sunday, 21 July 2013

Babbage pictures

Dave Ackerman tweeted a couple of pictures of the Raspberry Jam @ Cambridge Consultants yesterday, including this great one taken by Babbage-cam while he hung in meeting room 10/11.

Saturday, 20 July 2013

Raspberry Jam!

A couple of months ago, I went to a Raspberry Jam in Cambridge at the Centre for Mathematical Science. It was a great day out and I met some really interesting people, but the vending machine was a) a long way away and b) terrible anyway, and we had a lot of people in a small meeting room. "Next time", I bravely announced, "you should come over to my office. We'll lay on coffee and everything..."

Well, fast forward a few months and quite a lot of planning, and the second Cambridge Raspberry Jam of 2013 came to Cambridge Consultants.

Mike Horne is the local Raspberry Jam organiser and we're all very grateful to him for arranging these Jams and giving us Pi enthusiasts somewhere to go and talk about what we love. Mike arranged all the ticketing, the demos and the speakers. I arranged with Darina at Cambridge Consultants so we could borrow the reception area, and have teas and coffees and cakes laid on, name badges, etc. Many thanks for Darina for sorting this!

Myself, Mike and our two marshals (Rebecca Hoath and Alan Egan) arrived early to get set up and help those with demos. Thanks to our marshals for coming in to work on their day off and helping make the day a great success.

We kicked off with a brief hello from Mike, followed by an introduction to Cambridge Consultants by Tim Fowler. Tim talked about what Cambridge Consultants do and some of the projects they've worked on in past. These include internet radios, satellite telephones, round tea bags for Tetleys (yes, really) and the ground breaking VideoCore processor which they span out as a company called Alphamosaic. That spin-out was then bought by Broadcom about 9 years ago and it formed the basis of Broadcom's Mobile Multimedia division. That division is, of course, responsible for the Raspberry Pi, which contains a fourth-generation VideoCore processor at its heart.

We had six excellent presentations on the day (including one surprise addition at the end). I'll try and recap them briefly here.

Up first was Ryan Walmsley. Ryan talked about his first year with the Raspberry Pi and listed the many projects he's been working on. You'll most likely know of Ryan through his Rastrack website, which now has 30,000 Raspberry Pi's listed and is registration is included as an option in the standard raspi-config script. He also talked about his efforts getting Raspberry Pi recognised as a valuable distributed computing platform, demonstrating some examples he'd built on the BOINC platform.

Up next was the original Raspberry Pi designer Gert van Loo. Gert gave a really interesting talk on designing electronics for mass production. Did you know, the cost of a small capacitor or resistor is dwarfed by the proportional amount it costs you to hire the pick and place machine for the half-second it takes to lay out the component? For example, if you can get four resistors in a single package but they happen to cost, say 10 times the price, that might not actually be a bad deal because the robot will lay one large part much quicker than four smaller ones. Quicker layout means more boards per hour which means less cost per board. He also talked about the value of adding lots of 'just in case' options to your early designs - although you will of course always forget to add the one you need - and the simple joys of the physical effects you can generate when working with embedded programming. As an embedded engineer, I second that sentiment entirely.

Gert also brought along his son, David, and four Raspberry Pis set up to the audience to try their hand at embedded programming and drive a few Gertboards. This was a very popular activity.

I took the third presentation slot and talked about the work I'd been doing at Cambridge Consultants with the Zoological Society of London (ZSL). We've been building some remote camera traps for wildlife monitoring, but working with the tricky requirement that they had to upload images to the internet in near-realtime, from anywhere on the planet. Oh, and they had to last for ages on a single charge, survive extremes of temperature, submersion in water, angry hyenas, the usual. We've built some prototype cameras using Atmel XMega processors for low power consumption, and linked them with a bespoke wireless protocol to a central node, which houses a Raspberry Pi and an Iridium satellite modem. This modem incidentally, was designed by Cambridge Consultants so we know it inside-out. I was also able to share some pictures of the field trials - undertaken in an actual field at ZSL Whipsnade Zoo!

We then took a break for coffee and cake and everyone had a chance to look around the exhibits in the atrium people had brought along for the day.

Suitably refreshed, we sat back down for our fourth talk, which was given by Boris Adryan. Sticking to our entirely accidental "Embedded Engineering" theme, Boris talked about the trials and tribulations of monitoring the temperature of his wife's greenhouse wirelessly and how he was then able to use the technology at work to diagnose a dodgy refrigeration unit whose demonstrably poor temperature control was causing problems with some of his experiments.

Our fifth and final scheduled speaker was Jim Darby who also continued the embedded theme, by talking about how the Arduino board can be used in conjunction with a Raspberry Pi. Rather than using a slideshow, Jim bravely proceeded to talk through a whole series of live demos, from using a Pi to program an Arduino with a basic 'blinking light' demo, through to his amazing chain of colour changing LEDs, arranged as a 600-bit shift register. Here's a brief video and remember, each of these LEDs is individually controllable, so just about any pattern conceivable is possible:

Our final 'surprise' speaker of the day was High Altitude Balloon hero Dave Ackerman, who regaled us with tails of chasing his balloons across Europe, having sent them up so high they were able to take pictures of the curvature of the earth. Dave also brought along his latest project - a Babbage bear from the Raspberry Pi shop that had been stuffed with a Raspberry Pi, batteries, camera and long-range wireless modem. Babbage hung around the Cambridge Consultants atrium, taking in the view and broadcasting it live to anyone in the area with a suitable receiver.

We then retired to the atrium again to chat and look around some more demos. The event was so popular, people stayed around for over an hour past the official closing time. It's just too much fun talking to like minded individuals about all the projects we either have undertaken or want to undertake next!

I was very grateful that Eben and Liz Upton could join us on the day and I know many of the jammers were very excited to meet them in person.

Here are a few more pictures from the day.

I'm looking forward to the next Jam already!

Saturday, 9 February 2013

More Stellaris fun

My Github for the Stellaris Launchpad has had a cleanup. I've dropped support for using the ARM-Linux compiler as building without a C-library rapidly gets boring. The baremetal ARM compiler is a straightforward enough install (you unpack the tarball).

The linker script has become more complicated, but I've tried to explain what (I think) it all does.