maximale Eingangsfrequenz Counter AVR

Mar 24, 2016 13 Replies

Hallo,



ich hab hier ein Bastelprojekt mit einem PIC16F628 auf dem Tisch. Das


Wie ist das beim ATmaga? Ich kenn mich mit AVR Prozessoren ganz gut aus, aber irgendwie finde ich nicht die passende Seite im Datenblatt.


Stefan


Stefan schrieb:

Systemtakt gesamplet/synchronisiert, daher: "Since the edge detector uses sampling, the maximum frequency of an external clock it can detect is half the sampling frequency. However, [...] it is recommended that maximum frequency of an external clock source is less than fclk_IO/2.5."

Bleibt noch Timer2, der zwar asynchron getaktet werden kann, aber

external clock to the TOSC1 pin may result in incorrect Timer/Counter2 operation. The CPU main clock frequency must be more than four times the Oscillator frequency."

Christian

Christian Zietz - CHZ-Soft - czietz (at) gmx.net WWW: http://www.chzsoft.de/ PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA

Am 24.03.2016 um 10:39 schrieb Christian Zietz:

Stefan

externen Takt clocken lassen will, dann darf der maximal halb so

des Signals jeweils mindestens eine Taktperiode lang sein. Das gilt

Praktisch haben mehrere Leute damit bis 66MHz gemessen.

XL

Datenblatt: | | 6.2.1 EXTERNAL CLOCK SYNCHRONIZATION | | When no prescaler is used, the external clock input is | the same as the prescaler output. The synchronization | of T0CKI with the internal phase clocks is | accomplished by sampling the prescaler output on the | Q2 and Q4 cycles of the internal phase clocks | (Figure 6-1). Therefore, it is necessary for T0CKI to be | high for at least 2TOSC (and a small RC delay of 20 ns) | and low for at least 2TOSC (and a small RC delay of | 20 ns). Refer to the electrical specification of the | desired device. | When a prescaler is used, the external clock input is | divided by the asynchronous ripple-counter type | prescaler so that the prescaler output is symmetrical. | For the external clock to meet the sampling | requirement, the ripple-counter must be taken into | account. Therefore, it is necessary for T0CKI to have a | period of at least 4TOSC (and a small RC delay of 40 ns) | divided by the prescaler value. The only requirement | on T0CKI high and low time is that they do not violate | the minimum pulse width requirement of 10 ns. Refer to | parameters 40, 41 and 42 in the electrical specification | of the desired device. See Table 17-7.

Wirklich asynchron kann also scheinbar nur der Prescaler laufen und

bei PIC16 ist ja 1 Core-Cycle == 4 * Tosc).

Michael Baeuerle schrieb:

DoDi

Muss er ja nicht zwingend, wie man an dem Prescaler sieht.

Problem nicht haben. Synchronisiert werden muss hier nicht auf den

> It works.

formatting link

einen konsistenten Zustand haben.

soll, durchaus Sinn.

cu Michael

synchronisiert wird. Wenn ein CPU-Zugriff erfolgt, wird das Register

(synchron mit dem Eingangssignal). Kommt drauf an, ob sich dieser Aufwand lohnt.

Ja, das ist mir beim Schreiben meiner Frage bereits eingefallen. Typischer Fall von "Nachdenken mit den Fingern" ;-)

DoDi

Dann musst Du das Einfrieren des Registers aber mit beiden Takten synchronisieren, damit die Daten garantiert konsistent sind. Dazu sind

cu Michael

Ablauf der voreingestellten Zeit als Ausgang und setzt ihn auf GND.

Stefan

Stefan schrieb:

Gute Idee :-) Hilft aber nur weiter, wenn der Eingangspin nicht zwangsweise synchronisiert wird, wie beim ATmega.

DoDi

Das ist bei der Anwendung OK - der CPU-Hersteller baut die Timer aber so,

cu Michael

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required