AN666 SILABS [Silicon Laboratories], AN666 Datasheet - Page 32

no-image

AN666

Manufacturer Part Number
AN666
Description
USAGE GUIDE FOR SIM3U1XX, SIM3C1XX, AND SIM3L1XX DMA AND DTM MODULES
Manufacturer
SILABS [Silicon Laboratories]
Datasheet
AN666
It is also possible to instruct a state to hold off any further transfer requests until an external pin input (specified by
the INHSEL field in the CONTROL register) is asserted. The DTMINH and INHSPOL fields in the state structure
configure this capability for the selected inhibit pin.
9.1.4. Interrupts
Within a state structure, the user can selectively enable timeout interrupts and state transition interrupts. The
timeout counter and its associated interrupt are enabled using the TOERRIEN flag. If TIOERRIEN is set,
TOCOUNT is loaded with the value of TORELOAD on entry into the state. If the TOCOUNT field reaches zero, the
TIOERRI interrupt flag will be set, and the state machine transitions to DONE.
The PRISTIEN and SECSTIEN flags enable interrupts upon transition to the primary and secondary states,
respectively. When either of these interrupts occurs, the DTMI interrupt flag will be set by hardware.
10. Using the DTM Module on SiM3L1xx Devices for Peripheral-to-Memory-
The DTM allows DMA channels to automatically chain without core intervention. When creating DTM code, it is
recommended to first start with the basic peripheral configuration and verify the peripheral is configured correctly
before adding DMA support. Once the DMA operation is verified, add the final DTM piece to create the full system.
To set up a DTM system:
The DTM_Peri_to_Mem_to_Peri.c code example included in the software package demonstrates two basic DMA
transfers using the USART0 peripheral (transmit and receive) to receive and transmit a 20-byte character set from
and to a Terminal program on the PC using the CP210x USB-to-UART bridge on the MCU Card. The DTM
automatically starts the transmit DMA transfer after the receive DMA transfer, displaying the characters in the
Terminal program on the PC. This code example uses two different DMA and DTM0 channels for the two states S0
(receive) and S1 (transmit).
32
to-Peripheral Transfers
1. Enable AHB and APB clocks to the DTM module.
2. Start with DTM/DMA channels disabled.
3. Configure the DMA channel or channels. Ensure the DMA crossbar maps the DMA channels to DTM
4. Initialize the state fields for the DTM operation. For each state:
5. Initialize the DTM module.
6. Clear all interrupts in the DTM module.
7. (Optional) Enable DTM module interrupts.
8. Enable the DTM module and DMA channels.
channels. Wait to enable the channels until after the DTM module is completely initialized.
a. Set the DTM Channel for the state (A, B, C, or D).
b. Set the source field (SRCMOD).
c. Set the destination field (DSTMOD).
d. Select the next state for the primary state transition (PRIST).
e. Select the next state for the secondary state transition (SECST).
f. Set the number of DMA transfers for the state using the STRELOAD field.
g. Set any active interrupts or other options for the state.
Rev. 0.1

Related parts for AN666