Serial programming ATtiny24A fails sometimes. Too high oscillator frequency?

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

I'm doing Serial (SPI) programming of the ATtiny24A. I have an external 8 MHz oscillator for the ATtiny.

 

But sometimes when I flash the program memory and then read it back I get a mismatch on some byte.

 

Now when I check the datasheet it says on page 180 that the 1/tCLCL (Oscillator Frequency) is max 4MHz (My Vcc is 3.3V). Could it be this that causes the intermittent problem?

 

Can I solve it by setting the CKDIV8 fuse bit so the CPU runs at 1 MHz?

 

From datasheet

Last Edited: Thu. May 17, 2018 - 08:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that if you really mean "ISP" then one restriction is that it must be done at F_CPU / 4 or less.

 

Assuming you have enabled the tiny to run at 8MHz then ISP must not be done at any more than 2MHz.

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

Yes I mean Serial Programming through SPI.

 

The SPI SCK is run at 125 kbit/s, so that is OK.

 

What I mean is that the datasheet say that if Vcc = 1.8 - 5.5V the internal CPU clock must be max 4 MHz (I have Vcc = 3.3V). And by activating the CKDIV8 fuse bit I run the CPU at 1MHz.

 

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

Well if F_CPU = 1MHz and SCK = 125kHz that should be in spec.

 

There have been previous threads asking about the situation where the applied clock is higher than specified for Vcc but immediately divided by CLKPR to be within specification and I think the suggestion has been that it's "safe" to do that.

Last Edited: Thu. May 17, 2018 - 10:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like it is working now every time (programmed the CKDIV8). I have tested at least 200 times.