Go Down

Topic: ATtiny85 @ 16mhz with internal High Frequency PLL Clock (Read 6434 times) previous topic - next topic

gbm

Hi guys, experimenting we found the possibility to use an ATtiny85 or Pico85 SMD @ 16mhz with the  internal High Frequency PLL Clock.
To do this you have to regulate fuses removing divider, a easier technique is to modify boards.txt with the new clock and then program the MCU.
Here a video with software servo working well:
http://www.youtube.com/watch?v=PxwNOG1WzhY
Community robotica / programmazione Arduino
www.gioblu.com

bill2009

could you explain what you've done? How have you set the fuses?

Coding Badly


This entry seems to work well...

Code: [Select]
###########################################################################

attiny85at16p.name=ATtiny85 @ 16 MHz  (internal PLL; 4.3 V BOD)

# The following do NOT work...
# attiny85at16p.upload.using=avrispv2
# attiny85at16p.upload.using=Pololu USB AVR Programmer

# The following DO work (pick one)...
attiny85at16p.upload.using=arduino:arduinoisp
# attiny85at16p.upload.protocol=avrispv2
# attiny85at16p.upload.using=pololu

attiny85at16p.upload.maximum_size=8192

# PLL Clock; Start-up time PWRDWN/RESET: 1K CK/14 CK + 4 ms; [CKSEL=0001 SUT=00]
# Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
# Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at16p.bootloader.low_fuses=0xC1
attiny85at16p.bootloader.high_fuses=0xD4
attiny85at16p.bootloader.extended_fuses=0xFF
attiny85at16p.bootloader.path=empty
attiny85at16p.bootloader.file=empty85at16.hex

attiny85at16p.build.mcu=attiny85
attiny85at16p.build.f_cpu=16000000L
attiny85at16p.build.core=tiny

###########################################################################

guallini

#3
Apr 14, 2013, 03:35 pm Last Edit: Apr 14, 2013, 03:37 pm by guallini Reason: 1
Using ATtiny85 @ 16Mhz internal clock is the input voltage range 2.7V - 5.5V?

Coding Badly


From Figure 21-2. Maximum Frequency vs. VCC in the datasheet it looks like the voltage range at 16 MHz is about 3.3V to 5.5V.


Coding Badly

#6
Apr 15, 2013, 07:12 pm Last Edit: Apr 15, 2013, 07:31 pm by Coding Badly Reason: 1

Yes.  Maybe...

Quote
27.2 Errata ATtiny45
27.2.3 Rev B and C
1. PLL not locking
When at frequencies below 6.0 MHz, the PLL will not lock
Problem fix / Workaround
When using the PLL, run at 6.0 MHz or higher.


Quote
27.2.4 Rev A
3. PLL not locking
When at frequencies below 6.0 MHz, the PLL will not lock
Problem fix / Workaround
When using the PLL, run at 6.0 MHz or higher.



Running an ATtiny45 at 16 MHz using the PLL should work just fine.

twang

This has not been posted on in a while, but I just want to add to this forum:

The SoftwareServo library works well ONLY if your lfuse is c1. I tried df and that did not work; it only worked at 8MHz for me

So, c1 works the best

Thanks

Captain-DJ

#8
Mar 09, 2014, 01:47 pm Last Edit: Mar 09, 2014, 02:27 pm by Captain-DJ Reason: 1
Hello.

I try this, but it dont work.
Then i try to remove some lines and edit some :

Code: [Select]
attiny85at16p.name=ATtiny85 @ 16 MHz  (internal PLL 4.3 V BOD)

# The following DO work (pick one)...
###attiny85at16p.upload.using=arduino:arduinoisp               <- !!!
# attiny85at16p.upload.protocol=avrispv2
# attiny85at16p.upload.using=pololu

attiny85at16p.upload.maximum_size=8192

# PLL Clock; Start-up time PWRDWN/RESET: 1K CK/14 CK + 4 ms; [CKSEL=0001 SUT=00]
# Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]
# Serial program downloading (SPI) enabled; [SPIEN=0]

attiny85at16p.bootloader.low_fuses=0xC1
attiny85at16p.bootloader.high_fuses=0xD4
attiny85at16p.bootloader.extended_fuses=0xFF
#attiny85at16p.bootloader.path=empty                            <- !!!
#attiny85at16p.bootloader.file=empty85at16.hex          <- !!!

attiny85at16p.build.mcu=attiny85
attiny85at16p.build.f_cpu=16000000L
#attiny85at16p.build.core=tiny
attiny85at16p.build.variant=tiny8                             <- !!!
attiny85at16p.build.core=arduino:arduino                <- !!!     


Then i can use my Arduino Uno as ISP.

But i have some problems with the servo moving.  I made a short testing sketch :

Code: [Select]
void loop() {
 
  for (int i=20; i<160; i++){
    servo1.write(i);
    delay(10);
    SoftwareServo::refresh();
   
  }
 
  delay(1000);
 
  for (int i=160; i>20; i--){
    servo1.write(i);
    delay(10);
    SoftwareServo::refresh();
   
  }
  delay(1000);


The servo will move slowly, the fast many times in a short way, the again slow....not good !
I have also try without servolib.

Code: [Select]
void servoAngle(int angle, int Speed){
  digitalWrite(servoPin, HIGH);
  angle = map(angle,0,180,400,2200); // 500 , 2500 Winkel in Zeit umrechnen, siehe Bemerkung!
  delayMicroseconds(angle);
  digitalWrite(servoPin, LOW);
  delayMicroseconds(Speed);
 
}

void loop() {

   for (int i=180; i>=50; i--){
    servoAngle(i,15000);
  }
 
  delay(2000);
 
  for (int i=50; i<=180; i++){
    servoAngle(i,15000);
  }
   
  delay(2000);


But here i am testing about the values in the map funktion.
With 8Mhz this will be

angle = map(angle,0,180,500,2500);

But her also the movement ist not so good as with my Arduino Uno.
Short ways are sometimes to fast, or dont be moved.

Then i see this with 16Mhz and i hoped it will be better, but its not.
Dont understand why the servo is moves so good in this video :(

EDIT:
I think i have a power problem. First test was with my arduino as power supply.
The led are flickering a little.
Then i try with an external batterie pack for the servo and now it moves smooth.
I will try to install an big capacitor in the power line for the servo

Go Up