One solution is to put some NOP’s between instructions. A better solution is to use the GPxSET/GPxCLEAR/
GPxTOGGLE registers instead of the GPxDAT registers. These registers always read back a 0 and writes of
0 have no effect. Only bits that need to be changed can be specified without disturbing any other bits that are
currently in the process of changing.
•
GPxSET/AIOSET Registers
The set registers are used to drive specified GPIO pins high without disturbing other pins. Each I/O port has
one set register and each bit corresponds to one GPIO pin. The set registers always read back 0. If the
corresponding pin is configured as an output, then writing a 1 to that bit in the set register will set the output
latch high and the corresponding pin will be driven high. If the pin is not configured as a GPIO output, then
the value will be latched but the pin will not be driven. Only if the pin is later configured as a GPIO output will
the latched value will be driven onto the pin. Writing a 0 to any bit in the set registers has no effect.
•
GPxCLEAR/AIOCLEAR Registers
The clear registers are used to drive specified GPIO pins low without disturbing other pins. Each I/O port has
one clear register. The clear registers always read back 0. If the corresponding pin is configured as a general
purpose output, then writing a 1 to the corresponding bit in the clear register will clear the output latch and the
pin will be driven low. If the pin is not configured as a GPIO output, then the value will be latched but the pin
will not be driven. Only if the pin is later configured as a GPIO output will the latched value will be driven onto
the pin. Writing a 0 to any bit in the clear registers has no effect.
•
GPxTOGGLE/AIOTOGGLE Registers
The toggle registers are used to drive specified GPIO pins to the opposite level without disturbing other pins.
Each I/O port has one toggle register. The toggle registers always read back 0. If the corresponding pin is
configured as an output, then writing a 1 to that bit in the toggle register flips the output latch and pulls the
corresponding pin in the opposite direction. That is, if the output pin is driven low, then writing a 1 to the
corresponding bit in the toggle register will pull the pin high. Likewise, if the output pin is high, then writing
a 1 to the corresponding bit in the toggle register will pull the pin low. If the pin is not configured as a GPIO
output, then the value will be latched but the pin will not be driven. Only if the pin is later configured as a
GPIO output will the latched value will be driven onto the pin. Writing a 0 to any bit in the toggle registers has
no effect.
1.4.4 Input Qualification
The input qualification scheme has been designed to be very flexible. You can select the type of input
qualification for each GPIO pin by configuring the GPAQSEL1, GPAQSEL2, GPBQSEL1 and GPBQSEL2
registers. In the case of a GPIO input pin, the qualification can be specified as only synchronize to SYSCLKOUT
or qualification by a sampling window. For pins that are configured as peripheral inputs, the input can also be
asynchronous in addition to synchronized to SYSCLKOUT or qualified by a sampling window. The remainder of
this section describes the options available.
1.4.4.1 No Synchronization (asynchronous input)
This mode is used for peripherals where input synchronization is not required or the peripheral itself performs
the synchronization. Examples include communication ports SCI, SPI, eCAN and I
2
C. In addition, it may be
desirable to have the ePWM trip zone ( TZn) signals function independent of the presence of SYSCLKOUT.
The asynchronous option is not valid if the pin is used as a general purpose digital input pin (GPIO). If the
pin is configured as a GPIO input and the asynchronous option is selected then the qualification defaults to
synchronization to SYSCLKOUT as described in
.
1.4.4.2 Synchronization to SYSCLKOUT Only
This is the default qualification mode of all the pins at reset. In this mode, the input signal is only synchronized
to the system clock (SYSCLKOUT). Because the incoming signal is asynchronous, it can take up to a
SYSCLKOUT period of delay in order for the input to the device to be changed. No further qualification is
performed on the signal.
System Control and Interrupts
116
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......