Arduino mit ATTINY84 : CPU Takt korrigieren

Gast #4135655
Lesenswert?
• ▲
▼
Hallo,

ich suche verzweifelt die Stelle, wo außer in der boards.txt noch die 
Taktrate versteckt ist, die der Compiler/Linker als Grundlage für die 
delay Berechnung braucht. Aktuell läuft delay() 10 fach schneller, so 
dass ich dafür (mit Stopuhr) jetzt eigene Routinen erstellen musste, 
damit es wieder passt. delay basiert auf Timer0. Schalte ich den weg 
bleibt er in delay endlos hängen.

Schaue ich mir die Compiler Ausgabe an, scheint dort alles ok zu sein, 
dort steht -DF_CPU = 100000L oder 800000L je nach Einstellung. Nur die 
Praxis sieht dann anders aus, er läuft 10 fach schneller durch die delay 
durch.

Jemand eine Idee?


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

attiny84at1.name=ATtiny84 @ 1 MHz  (int osc.; BOD disabled)

attiny84at1.upload.tool=arduino:arduinoisp

attiny84at1.upload.maximum_size=8192
attiny84at1.upload.maximum_data_size=512

# Default clock (slowly rising power; long delay to clock; 8 MHz 
internal; divide clock by 8)
# Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 64 ms; 
[CKSEL=0010 SUT=10]; default value
# Divide clock by 8 internally; [CKDIV8=0]
# Brown-out detection disabled; [BODLEVEL=111]
# Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]

attiny84at1.bootloader.low_fuses=0x62
attiny84at1.bootloader.high_fuses=0xDF
attiny84at1.bootloader.extended_fuses=0xFF

attiny84at1.bootloader.path=empty
attiny84at1.bootloader.file=empty84at1.hex
attiny84at1.bootloader.tool=arduino:avrdude

attiny84at1.build.mcu=attiny84
attiny84at1.build.f_cpu=1000000L
attiny84at1.build.core=tiny

######################################################################## 
###
Gast #4135728
Lesenswert?
• ▲
▼
holger schrieb:
> Ach was. 100000L sind 100kHz.

Nö, da steht 1 Mio in der boards.txt. Nur ich habe einen Tippfehler 
gemacht beim Abschreiben der Message.


C:\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall 
-fno-exceptions -ffunction-sections -fdata-sections -mmcu=attiny84 
-DF_CPU=1000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 
-IC:\Arduino\hardware\avr\cores\tiny

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren