Frage zum SAM3S4B

OP #3401793
Lesenswert?

Hallo,
ich bin blutiger Anfänger was Mikrocontroller anbelangt, daher meine 
Frage zur "Output Control". Ich verstehe nicht ganz, wofür ich PIO_SODR 
bzw. PIO_CODR brauche. Im Datenblatt ist es erklärt, verstehe es aber 
nicht, da ich keinen Bezug dazu habe:

-----------------------------------------------------------------------
When the I/0 line is assigned to a peripheral function, i.e. the 
corresponding bit in PIO_PSR is at 0, the drive of the I/O line is 
controlled by the peripheral. Peripheral A or B or C or D depending
on the value in PIO_ABCDSR1 and PIO_ABCDSR2 (ABCD Select Registers 
determineswhether the pin is driven or not.

When the I/O line is controlled by the PIO controller, the pin can be 
configured to be driven. This is done by writing PIO_OER (Output Enable 
Register) and PIO_ODR (Output Disable Register).
The results of these write operations are detected in PIO_OSR (Output 
Status Register). When a bit in this register is at 0, the corresponding 
I/O line is used as an input only. When the bit is at 1, the 
corresponding I/O line is driven by the PIO controller.

The level driven on an I/O line can be determined by writing in PIO_SODR 
(Set Output Data Register) and PIO_CODR (Clear Output Data Register). 
These write operations respectively set and clear PIO_ODSR (Output Data 
Status Register), which represents the data driven on the I/O lines. 
Writing in PIO_OER and PIO_ODR manages PIO_OSR whether the pin is 
configured to be controlled by the PIO controller or assigned to a 
peripheral function. This enables configuration of the I/O line prior to 
setting it to be managed by the PIO Controller.

Similarly, writing in PIO_SODR and PIO_CODR effects PIO_ODSR. This is 
important as it
defines the first level driven on the I/O line.
--------------------------------------------------------------------


Danke

x8x8x

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