Forum: Mikrocontroller und Digitale Elektronik Port mit PINB toggeln


von Räuber Hotzenplotz (Gast)


Lesenswert?

Hallo,
in einem Thread wird behauptet man könne beim ATtiny25 mit
1
PINB = (1 << PIN4);
den Port PB4 toggeln.
Es funktioniert.
Aber:
1. Wo steht das im Datenblatt
2. Die Simulation im AVR Studio 4 macht es
3. Aber das ist im PORTB nicht rücklesbar

von avr (Gast)


Lesenswert?

Bei mir im DB, Seite 55, Kapitel 10.1 :
1
Three I/O memory address locations are allocated for each port, one each for the Data Register
2
 PORTx, Data Direction Register  DDRx, and the Port Input Pins  PINx. The Port Input Pins
3
I/O location is read only, while the Data Register and the Data Direction Register are read/write.
4
However, writing a logic one to a bit in the PINx Register, will result in a toggle in the corresponding
5
bit in the Data Register.

avr

von (prx) A. K. (prx)


Lesenswert?

Räuber Hotzenplotz schrieb:

> 1. Wo steht das im Datenblatt

10.2.2

von avr (Gast)


Lesenswert?

A. K. schrieb:
> 10.2.2

Also schon zwei mal, falls man es an einer Stelle übersieht ;)

avr

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.