Friday, 12 October 2018

Eggsactly

"I tell you, the good old egg is the foundation of daily life. Stop the first man you meet in the street and ask him which he’d sooner lose, his egg or his wife, and see what he says!" 
P.G. Wodehouse

As promised, here are pics of our three new girls - April (spotty), May (large lady) and June (petite-ish lady). They are about a year old, and lay flawlessly white gorgeous eggs filled with golden orange goodness.  
April, May and June - nice ladies, good eggs
Speaking of three new girls - Karpov, Fisher and Tal were shorn today and look magnificent in just their undies, well, see for yourself. Our shearer Corey reckons they're rated 15/10 for condition (his polite way of saying they are a bit fat we think).
Bald ladies, no laughing or pointing
And also on the topic of good eggs, here is our grand-puppy Ella trying to crack one of the mysteries of life.


Oh well, it's a gallant first attempt.

I'll crack it next time, promise...



Sunday, 7 October 2018

Grand Days Out

"And if the world went to hell in a hand-basket as it seemed to be doing, you could say good-bye to everyone and retreat to your land, hunkering down and living off it."
Jeannette Walls

The weekend can bring such joy! For instance one might receive from a neighbour fresh caught local trout. Then a sojourn into the wilderness to source three new girls for the coop (hello April, May and June - photos to follow). Further some wandering out among the orchard blossom and then a meal fit for the landed gentry.

Spot Kym on the balcony surveying her Queendom
Blossom now, cherry later!
All the local goodness on one plate

Interesting question from Oskar at the beach recently with our two dogs and one horse.

Dunno mate, just dunno...


Thursday, 4 October 2018

Another day, another AVR

"Obsession is the wellspring of genius and madness."
Michel de Montaigne

The original clock project is about to receive a major overhaul. Firstly the code for that clock is a mess - it doesn't do interrupts at all well, so the user has to hilariously wait for a full cycle to complete before the clock wakes up when the slide switch for "set time" is toggled. This leads to a dreadful disquieting delay where you have to wonder if the little blighter is going to respond to a simple and necessary request.

The code overhaul also comes at a time (pun intended) when new chips have arrived from 中国 in deepest darkest Tasmania - the ATmega8. We believe it was the original chip used in the Arduino, followed by the ATmega168 and finally the ATmega328 which is what the clock project has used previously in a standalone version.

Why change chips? The ATmega328 is going up in price, currently around AU $19.01 for 10 pieces, whereas the ATmega8 in the same form factor is around AU $9.29 for the same quantity. The interesting (!) part of the revamp will be whether the new code will fit in a "smaller" chip - the ATmega328p has 32k RAM, 2048b SRAM and 1024b EEPROM, whereas the ATmega8 has "only" 8k RAM, 1024b SRAM and 512b EEPROM. Won't it be hilarious if the new code is too chunky to squeeze into that space? Although it is true that our recent dabbling in the dark arts of avr assembler might help shrink parts of the code.

The start of the project involved the usual ubiquitous "blinky" code (the AVR equivalent of "Hello World") - i.e. can we get any code to work on the Atmega8? Well within 5 minutes it seemed we had bricked the first chip whilst trying to burn a bootloader on the assumption that it didn't come from the factory with an installed bootloader. However, it did come with a bootloader and now wasn't talking at all.

Quite a few hours of reading and a fair bit of swearing over the next 3 days resulted in finding and following the definitive guide to ATmega8 bootloading (thanks ElectroNoobs), with just the one twist in the tail. We didn't want an external 16Mhz crystal oscillator driving the chip, but rather we would prefer the internal 8Mhz oscillator, since in the clock project the timing aspect is taken care of by an external DS3231 module. But we set up the oscillator anyway, just to establish lines of communication:


New bootloader installed and functioning
Following the resurrection after the requisite three days of uncertainty, the next step was to reload the bootloader via the avr isp programming shield and re-burn the chip with the appropriate settings (internal 8Mhz) as shown below:

So many options - but the 8Mhz is the key
Finally a little blinky magic and we are back in action.



But why always with the stupid blinky? Well, it's easy to establish if there is communication with such a simple program. It's visual if you don't have an oscilloscope, and timing is easy to check to see if the fuses have been set properly. Oh, and it's pretty.


So now onward to rewriting the clock code, but first a little relaxation and reflection with Oskar at Kingston Beach - noice!


Oskar seeks inspiration overlooking his temple



Wednesday, 3 October 2018

Headlong into a fence

You'll reach into your wallet to brandish a photograph of a new puppy, and a friend will say, 'Oh, no - not pictures.'
Caroline Knapp

Yesterday at the park Kelly was chasing a ball (surprise) when she missed the visual cues relating to fencing wire and tried to grate herself. Ouch! So we have a cut tongue, lip and we are missing a bit of a tooth (again). You have to wonder at what point she will have at least a working knowledge of situational awareness?  She's fine (sort of), but my do we not need these heart in the mouth moments at our age. Look out soon for a photo of Kelly completely covered in tape and bubble wrap ready for her daily constitutional.

Ignore me at your peril
Speaking of pain and suffering - here is a link to three months of our lives as we recently revisited assembler programming using the attiny13A as inspiration. With a couple of overseas buddies cheering from the side, it has been a firkin of frustrating fun making the damn thing and we wish it well on it's voyage to publishing obscurity. Check this out:

    completetime:

        in r16, ADCSRA
        andi r16, 0b01000000
        ldi r17, 0b01000000
        eor r16, r17
        brbs 1, completetime
        in r16, ADCL
        in r17, ADCH 
        ldi r18, low(threshold)
        ldi r19, high(threshold)
        cp r16, r18
        cpc r17, r19
        brbc 2, ledon

Yikes! A well deserved lie down and a cool cloth on the forehead must surely be in order.


Saturday, 29 September 2018

Ring ring

I've been called many names like perfectionist, difficult and obsessive. I think it takes obsession, takes searching for the details for any artist to be good.
Barbra Streisand

We're not sure how good Barbra Streisand is at electronics, but details certainly caused a half-day delay recently when we first encountered the phenomenon of wire "ringing". The project seemed quite simple - make an attiny13a output to a common anode 7-segment display.

It started badly when two of the displays died in early experiments due to a lack of a current limiting resistor. Finally after a bit of fiddling about, the code was working well outputting the required hexadecimal numbers from an Arduino Nano test-bed. But every time we shifted (pun intended) to the attiny13a, weird extra signals led to faulty inconsistent errors in the display.

The lack of reproducibility was excruciating - and even weirder that an attiny85 behaved perfectly in the same circuit! Was it the individual chips? The circuit? The gods of electronics and their capricious cosmic interference?

Spot the smoothing resistors and capacitors (plus short traces!)
Nope - it was wire ringing in the circuit. As the display was on one breadboard and the chip on the other, a combination of 10 cm connecting wires (too long!), no resistors in line with the 74HC595 shift register (47Ω), no decoupling capacitors (47μF and 0.1μF) to filter the signal and just enough differences between the specs of the attiny85 and the attiny13a to be crucial.

So the final product worked, and it was so satisfying and frustrating at the same time that it has been set up on the breadboard ever since. It is fired up from time to time amidst much sighing, shaking of heads and clucking noises. Or, as Kym would say, "That's very nice, dear."