Monday, 10 February 2014

A quick word on fonts

I mentioned before that I might patch the font render to handle proportional as well as monospace. The eagle eyed will notice from the last post that I did. I also changed the font to something a little less CGA and a little more 21st century.

The font fix was easy - add a byte to the start of each glyph describing the actual width of the glyph. I then wrote a tool which worked out the maximum width of each glyph, to save a lot of tedious calculation. Fun arose when I found out the font I was using had glyphs centered in the box rather than left aligned like a sane person might do. Nothing some 16-bit left shifts couldn't fix though.

The font I'm using is Hallfetica Normal from http://www.henningkarlsen.com/electronics/r_fonts.php.

TFT up and running

Some success!

I'd been flailing around for a few days, trying to debug the more analog parts of my PCB. I was seeing a 5V rail at around 2V and my board reset when the backlight was connected, but fine without the backlight. This was all not helped by the fact I found I have at least two brand new micro USB cables that don't work (board lights up, CPU just resets - different cable, works perfectly).

So, I've removed the three MIC2005 high side switches and soldered some nice fat wire between the 3.3v input of the LCD and the 3.3v output of the Launchpad, and between the 5V input, Launchpad 5V pin and the backlight power pin.

Success!

If I can't get the load switches to work, it's possible I can get the LCD power consumption down to a manageable level electronically. If that's too high to remain on all the time, I'll probably need to build and off-board power control circuit. I have a spare output pin I can use to indicate "Do not power off" and with a few diodes and a small relay I'll have something that comes on with the ignition and turns off when the micro is happy to turn off.



Booting up! Apologies for the terrible brightness issues.

Saturday, 25 January 2014

DAB radio module

Leaving the dashboard for a moment and going back to the in-car entertainment, I've noticed that DAB modules are quite expensive. Much more expensive than desktop DAB radios in fact.

I was in Tesco today and saw a DAB alarm/clock/radio for £5. Five pounds. Well, that's got to be worth a poke - even if it lasts 10 minutes before I've blown it up it'll be good value.

Inside there are three boards. The smallest board takes 5V in and offers a headphone out via an 8-pin TSOP amplifier. The largest board runs the MMI and houses the screen and all of the buttons. That's connected via a 14-pin ribbon to the main event - a Gyro-1130E DAB module from GyroSignal Technology Co Ltd.

This FM/DAB module drives the single speaker directly, sends a 5 pin (differential) stereo audio to the headphone amplifier and carries a ton of plated through holes along each of, 14 of which go the MMI board as I mentioned before. The interesting bits are mostly hidden under a large can labelled 'Tunbow', but you can see an FC2507 (PDF) tri-band downmixer from Future Communications Integrated circuit Inc. I might try and lift the can at some point, but there's a whole lot of solder holding it down.

The "Tunbow" label on the can was odd, so I looked it up. It turns out, they make DAB radios and in fact make a radio in an identical case - the a Tunbow E80012. The only difference is in the picture, that has a segmented LCD, whereas mine has a dot matrix (which is actually as described in the specification, so perhaps the picture is just wrong).

Anyway, the audio quality isn't bad and I've seen references to a Gyro-1128 module receive praise in a full-size Audiolab 8200-T DAB receiver. This is quite promising. If I see another, I'll buy it so I can destructively lift the can and see what's underneath.





Sunday, 19 January 2014

The dashboard is coming along...

So I can tie input waveform sampling to LCD updates, plus the menu system will reset the various trip values on demand.



What remains is storing the trip values on shutdown, handling day/night mode, tidying up the MMI and making the PCB.

Wednesday, 15 January 2014

Fonts

I've elected to stay with 8-bit mode as I need the pins as GPIO. Text rendering works well provided you are careful to over print a region rather than blanking it first (which causes a flicker).

The fonts came from UTFT. I might patch them to add proportional support but monospace is fine for now. I've knocked up a basic menu system too.

Tired of all the wires the prototype, I ordered some PCBs from OSHpark.com. $50 for three, they should be here any day now.

Saturday, 21 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.