Pages: [1]   Go Down
Author Topic: ATtiny85 @ 16mhz with internal High Frequency PLL Clock  (Read 5561 times)
0 Members and 1 Guest are viewing this topic.
Milan
Offline Offline
Edison Member
*
Karma: 2
Posts: 1128
gioblu.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Logged

Community robotica / programmazione Arduino
www.gioblu.com

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 990
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12858
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


This entry seems to work well...

Code:
###########################################################################

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
 
###########################################################################
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using ATtiny85 @ 16Mhz internal clock is the input voltage range 2.7V - 5.5V?
« Last Edit: April 14, 2013, 08:37:28 am by guallini » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12858
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will this work with the Attiny45?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12858
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
« Last Edit: April 15, 2013, 12:31:33 pm by Coding Badly » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
I'm a high schooler.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.

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

Code:
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:
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:
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 smiley-sad

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
« Last Edit: March 09, 2014, 08:27:37 am by Captain-DJ » Logged

Pages: [1]   Go Up
Jump to: