attiny85 and external clock

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

HI,

 

I've made a attiny85 board that doesn't seem to work on external clock

The external clock is a crystal 7,328 Mhz  + 2x capacitor 22pf

I have a led on on PB0 gpio and manage to get it blinking with a basic arduino blinking sketch 

If I progam the fuse (lfuse:w:0xfd:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m) to use the external oscillator it doesn't seem to work (no blinking)

I've checked on the osc pins (PB3 and PB4) with a scope and I haven't seen anything oscillating :-(

 

But I can still come back to the internal RC fuse and get the system working

Does a new fuses programming requires that the clock defined by the current fuses works ?

Which would means that my crystal + capacitor clock is working ?

 

Thanks

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

Does a new fuses programming requires that the clock defined by the current fuses works ?

Yes.

 

I've checked on the osc pins (PB3 and PB4) with a scope and I haven't seen anything oscillating :-(

Not a good test, as the probe's capacitance will likely upset the oscillator anyway.

 

Instead, program the CKOUT fuse and check for a clock on CLKO (PB4).

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Thanks for the answer, but if I program CLKOUT on PB4, won't it disturb the crystal oscillation as PB4 is also XTAL2 ?

 

 

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

Thanks for the answer, but if I program CLKOUT on PB4, won't it disturb the crystal oscillation as PB4 is also XTAL2 ?

Well, it won't disturb the oscillation, but I expect the CKSEL bits override the CLKOUT fuse.  Good catch.  In truth, the t85 is so starved for pins, I've only once used a crystal.  Why are you troubling yourself with a crystal anyhow?

 

How do you have your crystal and caps connected?  Breadboard?  That's likely to have a negative effect.  Crystal and caps must be as close to the AVR as possible.

 

Do you have a bypass cap across VCC/GND?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

joeymorin wrote:

Thanks for the answer, but if I program CLKOUT on PB4, won't it disturb the crystal oscillation as PB4 is also XTAL2 ?

Well, it won't disturb the oscillation, but I expect the CKSEL bits override the CLKOUT fuse.  Good catch.  In truth, the t85 is so starved for pins, I've only once used a crystal.  Why are you troubling yourself with a crystal anyhow?

 

How do you have your crystal and caps connected?  Breadboard?  That's likely to have a negative effect.  Crystal and caps must be as close to the AVR as possible.

 

Do you have a bypass cap across VCC/GND?

 

I need a crystal for asynchronous communication

My problem is on a pcb board.

I've followed Atmel application note for oscillator pcb guidelines.

So they are very close to the MCU (caps first few milimeter from Attiny pins, crystal just after the caps)

The bypass cap is on the schematics but not solder yet :-(  (I haven't the right cap size in stock).

I will start by adding the bypass cap and then check PB4 clock out.

Thanks again

 

 

 

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

unless you have an extremely weird async protocol & data rate i would expect you would be able to achieve it (within specification tolerances)

 

 there is the option of using the RC celebration the internal PLL clock should also be adjustable to a usable freq.