Browsing Posts published in December, 2011

The parts have arrived! 17/12/11

FINALLY!

This morning my smiling postman delivered four more PIC16F876A’s and two opto-sensors.

The PIC’s are for the circuit boards (…I only had one, so making two talk with each other was more than a little difficult…), and the opto-sensors are for the generator.

I plan to have a disc with a couple of holes in connected to the main generator drive wheel that the back wheel of the bike runs on.

These sensors will provide interrupts to the PIC to show that the wheels are moving.  By doing it this way, it means there’s no need to modify a bike to fit an infra red sensor and it will mean that unlike the bike computers you fit to your own bike, there’ll be no need to input the wheel diameter.  Instead, it will measure the speed of the generator and therefore the ‘speed of travel’ of the bike.

Confused?

Don’t worry, it’s all been properly thought through.

SO, that means I can get changed into my ‘outdoor gear’ and go straight over to The Plots, hopefully for a hard day’s digging.

Being sat at a bench all day writing code and building circuits while eating the Co-Op’s finest donuts is great for the mind (…though not for the waistline, unfortunately…), but digging is good for the soul.

Of course, the promise of Mitzi to cuddle, gallons of Plot Tea to drink in the weak winter sunshine kind of helps too.

Cake & Carols 17/12/11

Tomorrow is our ‘Cake & Carols’ celebration down at our Plots.

We’ll be lighting the ‘Big Fire’ down on the Children’s Plot and hopefully we’ll be having some lighting courtesy of our pedal powered lighting system.  Unfortunately, we won’t have a bike down there (…The box in question is currently sat on my bench undergoing a major transformation -see the Power Blog for details…), but we’ll hopefully have enough juice stored in a battery box to provide adequate light to see our carol sheets so we can sssssssiiiiiiinnngggg!

Before, during and after the carols, we’ll be eating cake and mince pies, washed down with many cups of Plot Tea, no doubt.

Last year was the first time we’d done this, and it snowed as we were singing!

Just how good was that?

This year, however, PXI Nick has assured me he’s had a ‘Word With The Big Guy’, and though he can’t promise us snow, checking the weather this morning, there’s no rain on the radar, so as long as you dress up in warm clothing, there’s no reason to not join us.

It kicks off for 6.00pm and we should be hoarse by 7.00pm!

We look forward to seeing you then!

Another PIC board built. 16/12/11

Wednesday afternoon then yesterday, I built another little PIC board based on the PIC16F876A with just two display units on -this gives four digits of 0-9.

The difference with this board is that as I want to use it for I2C communications, I couldn’t use PORTC3 or PORTC4 because they are used by the I2C for SDA and SCL -that’s serial data and clock.

I therefore had to use two separate pins to power the ‘d’ and ‘e’ segments of the displays.

This wasn’t quite as easy as it sounds, but after a couple of hours re-learning about bit-shifts and the like, I got it fully working -it would count from 0 to 9 quite happily.

Then, I went back to my original board and modified that so I could free up those two lines.

Anyway, long story short and all that; now both boards are wired in the new configuration and both working well.

Now, I’m hoping that Farnell will deliver me some parts today.  I ordered some more 16F876A’s and a couple of infrared sensors on Wednesday and expected them yesterday, but as I had to go out to pick up some ink cartridges for Diane yesterday morning, I think I missed the delivery guy.  I need the 16F876A’s because I’ve only got one.  Trying to make two processors chat when you’ve only got one of them is somewhat difficult!

Anyway, as soon as the new 16F876A’s arrive, I’ll be able to put one in the other board, wire up for I2C then the fun will really begin as I get the two of them talking.

I know.  I haven’t explained this at all well, but please bear with me.

Its still early!

Soaking it up. 14/12/11

I left the board plugged in and switched on last night to give it a few hours soak testing.

And it all passed with flying colours.And counting.

To the right you can see it this morning, and it shows its been on for 10 hours, 39 minutes and 52 seconds.

What you can’t see is the dot between the ‘9’ and the ‘5’ which flashes briefly every second as the seconds count up.

Up at the top right, you can see the ’00’ of the speed indicators, which obviously is zero because I’m not on the bike pedaling!

Actually, I need to change a little of the code for doing the speed because it tends to ‘bounce’ as your speed varies, but a little tweak and it will be perfectly readable.

“So, Wardo,” someone shouts. “What’s the plan for today?”

Today I have to go down to good old Maplin’s to pick up yet more bits, and as I ordered them online last night after they’d shut, I expect a call very soon after 9.00.  And yes, now they’re starting to get their stock under control, I checked online, and they have everything in stock.

And talking of stock, yesterday I became the first person in Sheffield to buy Maplin’s entire stock of two different parts from both their Sheffield stores.  I pity anyone else who wanted BC547’s or those cute little 7-segment displays!

Today will be for some 32.768KHz crystals for the embedded RTC’s (Real Time Clock), some little 22pf and 33pf capacitors for running the main PIC clocks and some 330R resistors that drive the anodes of the display LED’s.  I may well see if they have any off-cuts of veroboard because I’m running a little low on that as well.

In other news, I spoke with Sheffield’s Best Electronic Engineer the other day -when I was waiting for that Farnell order to see what time they were likely to tip up (…just after I’d put down the phone!), and due to a mix up, he has a spare soldering iron he had to buy in an emergency because he couldn’t get a part for his Weller iron.

He said I could have it for Christmas!

Okay, its not a Weller, but it’ll be a whole lot better than the little Antex I’m using, and I’m going round to pick it up early next week, so HUGE thanks are in order to him for this.

Anyway, I’d better get in gear.  Much to do today.

14 seconds. 13/12/11

That’s how much the timing circuit gains in one hour.

Now, the purists out there would say I have to correct this, but at this time I really want to crack on with other, more exciting stuff -like getting two PIC’s to chat to each other via the I2C communications I’ve been talking about for the last few days.

Anyway, I’ve now got the bottom six digits showing seconds, minutes and hours as it should. And yes, its showing it in the right format -the seconds and minutes roll over at sixty as they should.

This only took a matter of minutes in ‘C’!  If I’d tried to do this in assembler, it would have taken forever to write and debug.

So, its down to Maplin’s to buy their entire stock of FA02C green segment displays (7) along with their entire stock of BC547C’s (…Er. One…)

More pictures later.

Where do you go? 12/12/11

Beyond: ‘Whose Cat!!’?

This morning, I waited for the postie like a little kid on Christmas Eve.  I was so excited, I really couldn’t sit still; pacing to and fro, nervously looking at my watch every two minutes.

Would he or wouldn’t he?

…And much to my chagrin, he didn’t.

All I received was some junk mail and some other stuff that wasn’t really important.

Ya, boo and sucks.

But then, just as I was glumly getting ready for the imminent arrival of Mr Ward Senior for our regular Monday lunch date, another postie turned up, big parcel in his hands and a large grin on his face.

“Waiting for this were you, Mr Ward?’  He happily exclaimed.

“You bet!  Merry Christmas!”  And I meant it.

So, before my dad arrived, I just had to open it up and check it was right.

And it was!

Throughout lunch, I’ll admit I kept looking at my watch.  I could hear the programmer, still in its wrapper at home, laughing at me.

As soon as I got in…

…I very calmly got a shower & shave, changed my clothes into the ‘All Grey’ comfy programming gear I seem to prefer, made myself a cup of tea then sat down at my bench and carefully opened it all up and plugged it all in.It works!

The Integrated Development Environment (IDE) was pretty cool about it being plugged in, so I set it up in software (…minimal, really…), then realised I had to make a programming lead to go to my new super-duper 8 digit display board.

ANYWAY, to cut a long and boring story only slightly shorter, suffice to say that my new board works (…Whose Cat??!!…), and not only that, it works exactly as I planned and built it to!

Okay, I tell a fib.  I’d forgotten that PORTA4 in an open-drain output.  This means that it can’t drive current, only sink it.  A quick 10K resistor up to the top rail soon cured that.  Oh, and there was a slight short between two of the segment address lines, but on clearing that, it worked absolutely perfectly.

And here you can see it to the right.  You can see the 10K just below to the left of the big chip towards the left of the board.

The top right and middle left digits are counting from 0 to 9 together on an interrupt.

The ‘.0′ you can see is the rev counter, sat at zero because I’m not pedaling!

What you can’t see because it’s so quick is the millisecond flash every second just to the right of that which tells me that the other timer is working perfectly.

Now, don’t worry.  I’ll very easily move the digits around so the top right two are showing revs and the bottom six will, at first, just provide a simple timer.  Once I’ve got this timer code in, I’ll leave it overnight to see if its drifts any.

Then I have to pop a couple of buttons on -one to change between km/h and mph and the other for that bottom display so it will show either and incremental counter, or on repeated pressing, count-downs from 10, 15 and possibly twenty minutes.

Then I have to carry on learning that circuit and circuit board making software I keep blathering on about.

Happy Days!

Ladies and Gentlemen… 11/12/11

…I present to you:

Speed!

Difficult to believe, but its true.

Two digits of your finest counts-per-second.

Yes, I know that ‘counts’ means nothing in the real world (…2.25m to be exact -the circumference of the back bike wheel…), but that’s only a quick calculation, and one I don’t need to do right now.

The most important thing will be to get the new programmer tomorrow morning, see Mr Ward Senior (…a regular Monday lunchtime fixture…), then its on with the dead comfy jogging bottoms, the old grey T-shirt, the worn-out slippers, and I can look forward to not having to shave or shower for days!

Seriously though, it means that once the new programmer is here, I can quickly port-over the code then get some sensible numbers of out it.

And I can’t wait!

Building veroboard ‘creations’ is all very well, but its bad for the eyesight and it plays havoc with the ends of your fingers as you have to keep wiping the veroboard to clear detritus from between the tracks.

And after that?!

Ah, then I have to get to grips with the free printed circuit board software I mentioned many, many months ago from Express PCB.

Then I have to design the board (…no mean feat…), and get it squirted over to Dave so he can make the circuit boards with his ace ‘fabbing’ equipment.

Should be done by no later than Thursday morning.

(…Hang on, I see a flying pig overhead…)

Today’s mission… 11/12/11

…should I choose to accept it will be to program the display board I built last week with some new code.  This will be to give me speed and distance.

Okay, its with the old chip, but as I’ve mentioned before, porting code across chips with ‘C’ and the Microchip Integrated Development Environment (IDE) is ridiculously easy.

It will give me a ‘feel’ for doing it on the ‘proper’ board in the next few days after the new PICKIT3 arrives tomorrow. (…It will arrive.  Its FARNELL, after all…)

BUT, of course there is a slight problem.

In the course of the madess that was the other night, I’m sure I’ve corrupted the code that is currently running on that board.

SO, I’ll have to make sure I’ve got a working copy of that before I try anything fancy with new code.

Mostly dry… 10/12/11

…but no sunshine!

Still, it is nearly the middle of December, so we couldn’t really expect anything else.  At least it didn’t rain heavily.  Any ‘spits and spots’ as the weathermen like to call them were easily deflected by the two gazebos we popped up.

With it being nearly Christmas, and what with the year finally winding down, yes, we could have done a load of digging to keep warm, but in the end I lit the pizza oven and Sara brought down a load of pizza dough, so while she and the rest of ‘the girls’ prepared for pizza, I got the oven going with some of the wood that Jon and Derek had chopped this morning.  As I’m still a real ‘Newbie’ with this oven (…and each and every one is different from another…), I was anxious to see just how it burned, how fast the wood was used, where the hottest place in the oven was, and a whole host of other ‘intangibles’ that enable you to get the ‘feel’ of it.

I know, I’m not being very clear here, but when you’re using one, it really is like a ‘living thing’, and it’ll take me quite a while before I’m fully confident in its use.

Anyway, before that all kicked off, I wandered around our plots, just looking and taking photos, but I’m afraid I’m not going to include any tonight, Dear Reader.

Why?Pizza oven in full flame!

Because they’re too depressing!

A grey sky over bare, grey earth, everything that just a few weeks ago full of life now thoroughly dead.

BUT, I will leave you with the only bright part of the day.

Our pizza oven in full flame in between the twenty (!!!) pizzas I cooked today.

Truly, a sight to warm the heart …and of course, fill the stomach!

Flickr photos

The latest photos are up HERE


SEO Powered By SEOPressor