It not a joke!!! It is the truth!!!

Giving people what they want: violence and sloppy eating

Previous Entry Share Next Entry
They've all got it in for me..
mini me + poo
lovingboth

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.

Mirrored from my website's blog, The deranged mad of a brain man.

This entry was originally posted at http://lovingboth.dreamwidth.org/567271.html, because despite having a permanent account, I have had enough of LJ's current owners trying to be evil. Please comment there using OpenID - comment count unavailable have and if you have an LJ account, you can use it for your OpenID account. Or just join Dreamwidth! It only took a couple of minutes to copy all my entries here to there.

  • 1
What are some other good vendors that still exist for obtaining prototype-y stuff like Arduinos? Or perhaps a Pi, as I'm already very comfortable with ARM stuff - no sense diving into AVR and complicating the project needlessly. Not that I won't later on, I'm sure. =:)

That code reminds of what we'd receive from the outsourced entity responsible for the Blackfin BF533 we'd selected to develop with, back in a previous professional incarnation. Highlights included the entire menu structure (being the framework for a personal media player) being written as multiply nested switch statements, one per menu/submenu, and an infinite loop, also nested twice, presumably for good measure. ^_^

I rather liked the hackery on the little mono OLED we used on another project - clearly actually a parallel interface device, they'd just bolted a shift register onto it and called it SPI. =:) Still, it worked, but only unidirectionally - you couldn't query it about anything, especially not the video memory.

The advantage of the Arduino is that there's no OS to get in the way, you can get a Forth to do control things properly :) and they're fast enough given that you're - without something like this - not doing video.

But ARM-based Arduino shield-compatible boards exist. Maple Labs were the first, I think, but they no longer do them, so it's people like Olimex.

  • 1
?

Log in

No account? Create an account