Browsing Posts published on 23/03/2013

Ladies and Gentlemen…

…And cats.

At about midday today, there was great jubilation here at Wardian Towers.

Yup, you guessed it.  I got a couple of LED’s to light.Two LED's.

‘No Big Deal,’ you may think.  ‘Surely, a switch and a battery would achieve the same thing?’

And you’d be dead right.  ‘Why use microprocessors and the ‘C’ programming language, when all you need is a switch?’

Ah, but there lies the rub.

Those two humble (…but very, very bright…) LED’s are being controlled by the black chip just down and to the right of them.  For the more technically minded, it’s a Microchip MCP23008e i2c input/output chip.

However, the key bit of that information is ‘i2c’.

After what seems like years of half-heartedly trying to ‘get into’ i2c, then giving up, I’ve now finally achieved i2c communication across two chips in the programming language ‘C’.

Even though I’d studied it extensively with Bang & Olufsen many years ago, I’d never built and programmed an i2c system from scratch until this lunchtime.And the other two lit!

The proof here is to the left.  I changed one byte of information sent to the MCP23008, and the other two LED’s are now lit.

Okay, not earth-shattering in itself, but you may remember my excitement all those years ago when I got my first ever LED to light when programmed from a PIC?

The same feeling, but better.

These four little LED’s now pave the way for the really fun stuff as I whack the RTCC (Real Time Clock Counter) into it. This will then tell the PIC the exact time and date whenever it switches on.  This paves the way for ‘workouts’ on the bike to be correctly time and date stamped, so I’ll know just how much was put in, or taken out, of the battery over a given period.

Then, I’ve got the excitement of adding the cute little LCD display panel that also runs from i2c.  Different chip, but same protocol.

So, you can see, Dear Reader, things at Wardian Towers are moving forward.

…Even if the weather isn’t!

Ah.  That’ll be snow, then, will it?

Towards the end of March, there’s about a foot of it on the ground, and apparently there’s more to follow!

>sigh<

So, no Plotting for LEAF today, but I’ve been more than busy doing dead fun stuff.

(…well, it is for me, anyway…)

I hope there’ll be more in this column when/if the snow melts!


SEO Powered By SEOPressor