FromAnotherPlanet: 8254 - Counter 1

Beitrag lesen

Hallo Leute,

hat jemand von euch mal unter C was mit 8254 Countern
programmiert ?

Ich habe da so ein Verständnisproblem.

Der 8254 hat ja drei Counter (0,1,2,3), wobei das dritte
das control register ist... BLA BLA BLA.

Wer sich auskennt, sollte wissen was ich meine :-).

So, das Problem ist folgendes. Ich habe ein fertiges Kontrollwort
das so lautet :

0111 0110 = 0x76

Dieses Kontrollwort will ich per C-Funktion "outp(portadress,bytevalue)" in das control register schreiben.

Ich habe eine Lösung zu diesem Problem vor mir, die folgendes beschreibt :

outp(0xAC + 3, 0x76); // init Control Word
outp(0xAC + 1, 100); // Reloadwert "100" wird LSB geschrieben

outp(0xAC + 1, 0); // Reloadwert "100" wird LSB geschrieben
---------
outp(0xAC + 3, 0x40); // latch

z = _inp(0xAC + 1)); // read LSB
z += _inp(0xAC + 1) << 8; // read MSB

Folgendes Schema wurde verwendet :
                                ___________
0   A0 ------------------------|           |
0   A1 ------------------------| 8254      |
                       ____    |           |
1   A2 ---------------|    |   | CS        |
1   A3 ---------------|    |-->|           |
0   A4 --------------o|    |   |___________|
1   A5 ---------------| &  |
0   A6 --------------o|    |
1   A7 ---------------|    |
                      |____|

Also die Basisadresse 0xAC ist links abgebildet :

1010 1100 = 0xAC. Ich glaube das so richtig oder ?

Woher kommt die Basisadresse 0xAC, die normale Basisadresse fangen doch bei 300H an oder ? ?

Kann mir jemand helfen, ich komme nicht richtig weiter ?

Gruss