Go Down

Topic: Sketch to an ATtiny861a (Read 5121 times) previous topic - next topic

rcstan

Ended up using the tiny85 at 8Mhz with UNO.
I got the project done. Now all I have to do is mount it on the quad copter.

But after programing the tiny861 at 1Mhz, I clocked the flash of an LED with a test
   blink sketch. It lost one second after 15 minutes.
I didn't clock the 85.
Thats close enough for what I'm doing for now.

If the sketches are working, Could the bit rate difference shorten the life of the chip?

Coding Badly


rcstan

When you talk about SPI bit rate, is that the upload, data transfer speed to and from the chip?
How many bits it can process per second.........1Mhz?

Sorry for stupid questions.
I know very little about these chips and the terminology.
Thanks
Stan

Coding Badly

When you talk about SPI bit rate, is that the upload, data transfer speed to and from the chip?
The terms "target" and "programmer" are often used.  The "target" is the processor being reprogrammed.

Yes.  By "bit rate" I mean the transfer speed between the programmer and the target.

Quote
How many bits it can process per second.........1Mhz?
The maximum bit rate to the target is the target's processor speed / 6.

If the target is fresh from the factory it is running at 1MHz so 1MHz / 6 = 166666.  The next lower closer bit rate is usually 125K bits per second so that is the usual choice.

If the target has been reconfigured to run at 8MHz the maximum bit rate is 8MHz / 6 = 1333333.  The next lower closer bit rate is usually 1M bits per second.

I believe there is also a second limiter independent of the target's clock that keeps the maximum bit rate at 2M.  If you need the details check the datasheet (serial programming section).

Quote
I know very little about these chips and the terminology.  Sorry for stupid questions.
Knowing very little hardly makes your questions stupid.  No one is born knowing how to serial program an AVR processor.


CrossRoads

Why /6 and not /8?
/6 looks funny.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Coding Badly


In an ideal world, according to Nyquist, it should be 4 (2 target CPU clock cycles for the each SCK transition).

This is from the typical AVR datasheet...
The minimum low and high periods for the serial clock (SCK) input are defined as follows:
Low: > 2 CPU clock cycles for fck < 12MHz, 3 CPU clock cycles for fck >= 12MHz
High: > 2 CPU clock cycles for fck < 12MHz, 3 CPU clock cycles for fck >= 12MHz

I have no idea why they made the description so cryptic.  If you wade through that mess you will discover that the minimum low and minimum high period is simply 3 CPU clock cycles.  So, we divide by 6.


CrossRoads

Wonder if that still applies when using the SPI pins for programming?
Guess it doesn't really matter.
I know for initial bootloading of a brand new blank part the clock rate is slowed down. Subsequent downloads can be faster. Atmel Studio lets you select the speed. 
Maybe the IDE just uses slower when burning a bootloader.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Coding Badly

Wonder if that still applies when using the SPI pins for programming?
It does.

With the caveat that the lowest bit rate for the SPI peripheral is 16MHz / 128 = 125K.  If the target is running from the watchdog oscillator the SPI peripheral won't work (bit-banging is required).

Quote
Maybe the IDE just uses slower when burning a bootloader.
I don't think the IDE changes the default bit rate of the programmer.

ArduinoISP is hard-coded to use 125K.


Go Up