Saturday, March 25, 2017

Ural Gear Up: Cracked seat post repair and doubling up rubber supports

I've got a 2005 Ural Gear Up - and I noticed towards the end of last fall that my seat was getting really, really soft and bouncy on rough gravel roads.  On top of that, I was having to hold myself forward or I'd go sliding off the back.  Clearly, this isn't how things are designed to work - so I investigated!

What was the problem?  My seat support cracked, and was allowing far more movement than intended.  On top of that, the rear rubber support ("spring"?) was old, and simply didn't offer as much resistance to movement as it once did.

How bad were things?  Well... here's how far the support had cracked.  It wasn't completely through, but it was getting there in a hurry.

Time to fix this!  Fortunately, I know someone who is quite good with a welder.

Saturday, March 18, 2017

Uraling Through the Winter

In October 2016, I bought a Ural.  Specifically, a 2005 Ural Gear-Up.  This is one of the 2WD models, and it comes with pretty much all the various gizmos - shovel, spotlight, fluid container, machine gun mount, spare tire, rear rack... just about everything you could need!

I rode it all the way through the winter this year (which was a particularly rough winter for the area), put a few thousand kilometers on the clock, have done some work on it and added a sidecar windshield, and at this point I think I have a decent feel for this particularly obscure and unique form of transportation that is the source of endless questions from, well, everyone.

Why do I own a Ural?  Partly, I've wanted one for years.  However, it's mostly because a Ural is a motorcycle that can carry my daughter in the sidecar while my wife & I ride (we both ride).  So far, my daughter loves it, and we're planning on quite a bit of riding this year.

But... Ural?  If you're curious, read on!

Saturday, March 11, 2017

I2C LCDs: Reverse Engineering the I2C Converter

If you need a basic LCD display for an Arduino or Raspberry Pi, it's hard to beat these I2C LCD kits you can find for about $5 on eBay.

Some of them come soldered, some require you to solder things together - but they're cheap, they're I2C, they work... and they are incredibly frustrating when you didn't write down the magic incantation to initialize the LiquidCrystal_I2C class, and cannot manage to get the silly things working again!

Fear not!  With a bit of time, a bit of knowledge, and a cheap multimeter, you can figure out exactly how to set one of these up, starting with nothing but the adapter module!

Read on, if this particularly arcane corner of tech interests you.  But you're probably here from a search engine...

Saturday, March 4, 2017

Fixing Fake FTDI FT232RL Adapters (SSOP-28 rework with an iron)

The FTDI FT232R chips are an incredibly well supported and common way of building USB to serial adapters (usually 3.3V or 5V TTL levels).  The chips have built in drivers on all major OSes, they're easy to find - and almost all the cheap ones adapters there are using fake chips.

But, with a bit of time and patience, you can replace the fake FTDI chips with legitimate ones!  If you like the form factor of your preferred cheap adapter, but need the performance of a real FTDI chip, it's quick and easy to swap them out!

My first attempt (on the left) failed, but I then knocked out 4 functional replacements (on the right).

I'm talking about these adapters - you can find them for about $2, shipped, on eBay.

The chips aren't fake in the "Oh, the factory ran an extra few shifts off the books" sense.  They're fake in the "The fake chips are actually a microcontroller programmed to behave (almost) exactly like the FT232R" sense - and, they do a pretty good job at low speeds!

Zeptobars did some analysis and demonstrated that the fake chips are completely different under the hood, and then of course FTDI messed with their drivers to either brick the fake chips or insert garbage data if you're using one on Windows.

I have a bunch of these adapters laying around (purchased before I realized just how common the fake chips were), and while they work just fine at 115200 baud, they don't work reliably at 3M baud.  I spent a while troubleshooting some connections - things just weren't working right and an awful lot of garbage was coming across my link.  I eventually discovered the problem with fakes, and set out to both fix my problem and learn some surface mount rework skills.

So read on!

Saturday, February 25, 2017

LiteESP8266Client: AT Command library on 100 bytes of SRAM!

Two weeks ago, I grumbled about the state of Arduino libraries (they use too much SRAM for stupid reasons).

Last week, I presented a zero-global-SRAM serial logging library.

This week, I'm offering an ESP8266 AT client library that uses 100 bytes of SRAM (if you use my zero-SRAM serial library for serial output) - almost entirely used within the Software Serial library.

More importantly, I'd like this to show off how to do a fairly complex library without using nearly as much SRAM as the alternatives!

If this is something that interests you, read on!

Saturday, February 18, 2017

LiteSerialLogger: Zero SRAM Serial Logging

Last week, I talked about Arduino library memory use - and pointed out that the Serial library, in particular, is entirely wasteful for the purpose of simply writing log messages out to the serial port.

What's one to do about this?  Well, one can do many things, but what I chose to do is to write my own serial logging library - that uses zero SRAM except when actually writing messages to the serial port!

This isn't the first time I've written something along these lines.  Every few years, I seem to find myself writing yet another serial output library for some reason or other, and serial UARTs are pretty boring to bang bits into at this point.  They're slightly more exciting if they have a FIFO bolted on and a high speed clock, but not by much.

In any case - take a look at this!  A basic Arduino sketch uses 9 bytes of dynamic memory or SRAM (for the millisecond timer), and with an awful lot of serial logging, I also use a mere 9 bytes!

What's this library?  How did I write it?  And how can you use it?  Read on!

Saturday, February 11, 2017

Common Arduino Library SRAM Use

I've been playing with Arduino for a few months now, and one of the things I've found incredibly frustrating is just how much dynamic/global memory (SRAM) most of the common libraries use - the standard Serial library uses nearly 200 bytes of precious RAM, always and forever, just to print a single log message, and a lot of others aren't that much better.

Further, advice about Arduino memory pressure tends towards the handwavy "Well... don't use globals, and use the F() macro..." side of things - which, while accurate, is missing some very important information for understanding what is happening and how you can resolve the issues.

Here's a particularly bad example of what I'm talking about.  With literally nothing done but some libraries initialized, this code is using 1101/2048 bytes of RAM - 53%, and I haven't done a single useful thing yet!

I'm going to dive into library memory use in some depth, look at a few examples, and profile some commonly used libraries!  Read on if you're interested!