They've all got it in for me..

1. Over the past couple of days, I've gotten around to testing the kit I bought from the bunch who were closing. It looks like they sent six 'lots of red LEDs' shields rather than the five red and one (more expensive) white LED version. I'm now pondering whether or not to get a partial refund from PayPal. On the one hand, it's not much money, but on the other, I'm still very annoyed at their taking the documentation for their kit off the web and stopping it being archived by Google / Archive.org.

2. Speaking of bad documentation, the other thing I've been testing is a small touchscreen LCD shield for Arduinos and compatibles. Checking, I bought it from a Chinese website almost exactly a year ago but never got around to playing with it. Problem one is that it came with zero documentation. Problem two is that, although the basic shield is fairly widely available, there are at least half a dozen different controller chips in use generating the displays and which any particular board uses looks to be almost completely random. Even this bunch have used several different ones, and of course, they all need talking to in more or less different ways.

So I attach it and the Arduino UNO clone it came with via USB. Well, the display lights up white. Let's try programming it. A quick look reveals that it should use a Spfd5408 controller, and someone's done a driver library for that, based on the one done by Adafruit.

The test example uploads to the Arduino, says it's working over the serial interface, but doesn't actually do anything on the display. Apart from flicker, once, when the Arduino is reset.

Hmm. A look at the reviews on the page show quite a few people moaning about this sort of thing, but the vendors point to a file somewhere..

.. that no longer exists.

Fortunately, someone mentions the file name and a search reveals a copy in someone's 'Live Drive'. There's quite a bit in it, including a user manual (in Chinese), a PNG image with various dimensions, a 239 page datasheet (in English!), the libraries, and various other stuff mostly in Chinese.

The test example uploads to the Arduino, says it's working over the serial interface, but doesn't actually do anything on the display. Apart from flicker, once, when the Arduino is reset.

Hmm, a look at the code reveals this:

  uint16_t identifier = tft.readID();
identifier=0x9341;
  if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else if(identifier == 0x9341) {
    Serial.println(F("Found ILI9341 LCD driver"));
  } else if(identifier == 0x8357) {
    Serial.println(F("Found HX8357D LCD driver"));
  } else {
    Serial.print(F("Unknown LCD driver chip: "));
    Serial.println(identifier, HEX);
 

Or, in English, 'read what chip it says it is, immediately overwrite the result with the value for one of the five chips the library will presumably work with, then work out and announce which chip it is'. Taking out the naughty line reveals that it's reporting as having an identifier of 0xC0C0.

Which it doesn't know about and clearly can't cope with.

Fortunately, another link leads to another bit of code that does work, and the display is now being wiped with red, green and blue in turn in an infinite loop.* Unfortunately, that's all the code does and adapting the considerably more powerful libraries – as you might have guessed from the length of the datasheet, these chips are quite powerful – into using the right registers etc has been left as an exercise for the buyer.

I'd complain, but I see that I paid the equivalent of $5.10 for the display, the Arduino clone, and a USB lead. The clone is worth rather more than that. I couldn't post it all back to China for that much!

3. Rather than typing all this stuff, I was supposed to be taking JA for a guitar lesson near Lincoln with a new-to-us group. Except that when I got in the car, I noticed that the driver's wing mirror was turned in. I'll just push it back out..

.. ow, that's broken glass!

Someone's hit it and smashed it completely.** The passenger side one was broken a couple of years ago, and partly because it wasn't me that broke it while driving along, I've never bothered to replace it. It's not legally necessary and it does still give an indication of what's on that side. Neither of those apply to the driver's side: you have to have one and it is completely shattered.

Fortunately, I can get replacements for the glass and have it in a fixed position. Having proper adjustable replacements would probably cost a large chunk of what the car's worth… ditto putting in a claim on the insurance.

* Reminding me of the beautiful lights of Balham, 'changing all the time: green… amber… red… red and amber… and back to green.'

** Although the impact must have been obvious to whoever did it, there's no note. Sadly, there's no sign that it smashed their wing mirror too.


Leave a Reply

Your email address will not be published. Required fields are marked *