Programming without a clock

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After some time trying to figure out why I couldn't program my AVR, I tried putting a crystal across XTAL1/2. Suddenly I could program it! I assume this indicates that an oscillator or clock source is needed while programming.

Let's say I don't have a crystal or any sort of means to generate a clock signal AND I have my fuse bytes set to something other than the internal clock... is there still a way to program the AVR?

This is purely out of curiosity.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
is there still a way to program the AVR?
Yes, depending on the AVR, JTAG and HVPP.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's a common trick that I learned here on AVR Freaks: You can hack a clock out of a serial line: program the serial line (say, from your PC) to send "U" constantly (8-N-1) at some nice baud rate. Convert the serial line to a logic level (through something as simple as a resistor divider network, or if you have an RS-232 converter on board, use it's output) and feed it to the clock line. Voila, you have a clock running at the baud rate (since ASCII U is binary 01010101).

Or, if you have a 555 timer hanging around, hack together a quick clock reference.

Clock sources are really simple to build. An oscillator and a huge-gain amplifier following usually does the trick. Heck, if you have a Hex Inverter chip, tie an odd number of inverters into a chain with some caps on each stage.

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

stu_san wrote:

Clock sources are really simple to build.

Quite true. I just put together an oscillator, to measure some bags of mystery crystals, out of one jfet (floor sweepings from a job I had in college - I keep everything!) and two resistors.

555s, an AVR toggling an output, some hex inverters, there are lots of ways to get a clock pulse. But I hadn't thought of the serial port as a clock source before.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a multimeter with a 4096Hz clock output. Good enough to restore fuses, nothing to build....not that I ever need it of course... :?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wonder if you can connect to the o/p of a digital/analog watch to get the 32.768kHZ signal for a clock.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

npat_avr wrote:
I wonder if you can connect to the o/p of a digital/analog watch to get the 32.768kHZ signal for a clock.
:lol: A Real Engineer(tm) would be able to do it assisted only by his trusty Swiss Army knife!

Even better, s/he will have figured out how a USB Digital Watch can be used to supply to clock directly and download to the AVR!

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!