Thanks to all who advised on this topic - it's been a valuable tutorial
for me.

I have the system working - the mysterious and seemingly random oddities
came from the programme freezing in a loop which was supposed to watch
for a signal from the ADC.  (Write 100 times: "I will make use of
external interrupts.")  After commenting this loop out and putting in
half a dozen calls to my "short delay" (loop of 10 nops), everything
started working just fine.

This:

        while (PINC & _INT)
        {
                asm volatile("nop");
        }

...I was polling the interrupt out of the ADC rather than hooking into
my external interrupt pin.  Hmm...

Became this:

        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)
        smalldly();     // Don't rush the ADC ;-)


Unfortunately, the electronics are now outside drying off; I hooked into
the pump, tried to prime it and both the controller and I got wet when
it backfired...

Cheers

M

-- 
Matthew Smith
South Australia
http://www.kbc.net.au


_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to