Well not literally, there’s no room.

Here at ‘Wardian Towers’, while there’s just about enough room to swing a cat, it doesn’t really matter as he’s such a big softie and doesn’t mind a few cracks round the head.  But I digress…

No, I’m talking about me using a new PIC processor to control everything.

Step up the PIC16F887!

If you’re of a mind to check out the official datasheet, you’ll see that by comparison, this really is a ‘Bad Boy’.

It’s basically the same as the 16F684’s I’ve been using inside, but as I said in a previous post, this has ‘more legs’ to do all the interesting stuff with that users will come to know (…and hate, when they realise they’ve only cycled a fraction of the distance they thought they had…), but luckily has the same Reduced Instruction Set (RISC) with only 35 instructions to learn.

The PIC16F684 and the PIC16F887

The PIC16F684 and the PIC16F887

In the photo on the right here, you can see just what I’m talking about, size-wise.  The ‘684 is the ‘little’ 14 pinner while his big brother, the ‘887 is the fat forty pin monster.

So why the change now?

Weeeell as I hinted the other day, the ‘684 was ‘running out of steam’ pin-wise.  I was needing ‘tell-tales’ to show when certain conditions had been met -things like certain voltages or currents reached, but kept finding that I didn’t have enough I/O’s (Input / Outputs) to play with.

As you can see, the new ‘887 has plenty of ‘spare’ legs.

Still, it’ll need them to be able to run a series of displays and other I/O’s that are planned.

I’ve been reading up on lead-acid batteries, and while the bog-standard, cheapo car batteries we’re using will certainly suffice for right now, I think the final batteries need to be ‘leisure batteries’ that are used in boats and caravans -and funnily enough, solar and wind powered projects.  These differ from the standard batteries in that they will withstand a ‘deep discharge’.  A ‘normal’ car battery is only really used to start the car and it doesn’t need to be able to withstand repeated charging and discharging.  A leisure battery is quite at home with being almost totally ‘flattened’ without too much damage.  Looking on The Web, we can pick some of these up for not much more than car batteries.

So, armed with that new knowledge, I’ve decided to include a ‘Real Time Clock’ (…or ‘RTC’…) unit.  These clever little devices, once programmed with the current date and time will store and update automatically, only requiring minimal input from a processor.

This ‘real time’ information will be essential for long-term battery monitoring as I can store details of the batteries’ useage and will have all the accurate time stamps stored alongside.

Also the RTC, because it requires setting from a computer, needs to have an ‘RS232′ port available to communicate. Now, my current PIC programming board running off my desktop here uses that same port to communicate.

This then leads me into thinking that I may as well include a little extra circuitry to actually program the PIC in-situ, rather than have to keep taking it out to program on its dedicated programming board.  The actual circuitry required for the programming is only five transistors, a few resistors and a handful of diodes, and there’s plenty of room on the new piece of ‘Verboard’ I bought today.

This really would make the circuit portable, and I’d easily be able to make changes actually on-site at The Plots using the ‘new’ laptop I bought from Taplin Computers a couple of weeks ago.  Maybe a bit like ‘Aliens’ where they have to program the remote gun sentries using a laptop.  Just without the guns.

If I did do this, I’d need the ‘Vpp’ or ‘programming voltage’ for the PIC which is an inconvenient 12 volts.  All the current ‘computing’ parts of the circuit use the industry standard of 5 volts, but luckily, Maxim came to the recue with a really cute little chip that only needs a couple of capacitors to give out 12 volts at a more-than-adequate 50mA. If you’re interested, simply type ‘DS1305′ into the search box and it’ll take you right to it. Needless to say, a few free samples are on their way to me.

Unfortunately, not much will get done on this new circuit tomorrow in the day as I have an exciting trip to Manchester planned.

I regularly trawl eBay, always on the look out for bargains, and a week or so ago I came across an oscilloscope, the same make and model as I used down at DCS all those years ago.  It was a Hameg HM604-2 running at 60 MHz.  Now, I know for a fact that these beasts are not cheap, even ‘second-hand’, so I watched the auction with interest.

A few days went by -it was on a 7 day listing- and nothing had really happened to its price.

So, I told Diane all about it -maybe a little excitedly, but there you go.  She asked if I needed it, and I answered quite truthfully that it would come in very useful.  Some of the waveforms I’m dealing with on this circuit will be quite the strangest I’ve ever seen -particularly the waveforms for the chopping FETs.  Very handy indeed…

‘Go for it!’ she said, and I gave her a ‘tentative’ limit as to what I thought it might go up to.

Well, the auction ended at a little after 8.30pm on Monday, and…  …I got it!

Diane was actually here for it -I’d invited her over for dinner and the auction, and I think she was pretty impressed with my ‘cool’ over it all.  I’ve found that with eBay, the trick is to wait as late as possible to put a bid in, and I certainly don’t bid days or even hours before the auction -that just drives the price up!

So, Diane was sat on the settee, nervously looking over at me, but didn’t make a sound as the seconds counted down.  With barely two seconds left, I hit ‘return’ and whacked in a bid that was potentially miles over what it stood at, and sure enough, I ‘won’ it.

I let out a great whoop of delight as the screen confirmed my winning, and Diane let out an enormous breath -she’d been holding it!

So tomorrow, it’s over to Manchester to pay for it and bring it home.

…And yes, Dear Reader, I’ll be sure to take plenty of ‘screen shots’ of the various waveforms in my circuit!

Also tomorrow morning, Diane and Matt are doing something very special for LEAF that I may be able to tell you about this weekend.

Fingers crossed, eh?