Beruflich Dokumente
Kultur Dokumente
Summary
This document describes how to use the high-speed transfer mode of the data transfer controller (DTC) to transfer A/D
conversion results to the conversion result storage area located in the RAM.
Contents
2. Specifications ................................................................................................................. 5
Start
From Figure 1.1, Flowchart of
DTC (High-Speed Transfer)
Internal Operation (2/2)
Enable DTC activation Writes 1 to the bit in DTCENi register corresponding to the DTC (high-speed
2
transfer) activation source to enable DTC (high-speed transfer) activation.
No DTC activation
request generated?
Yes
Selects the data for the DTC control data number corresponding to the peripheral
Read DTC vector table function interrupt request from the DTC vector table set in the DTC base address register
(DTCBAR).
Read dedicated Reads the dedicated high-speed DTC control data if the DTC (high-speed transfer) activation
high-speed control data source is that selected in the high-speed DTC channel select register (SELHSm).
Yes
Final DTC (HDTCCTm = 01H)
(high-speed transfer)
transfer?
Yes
(Repeat mode: HMODEm = 1)
No Repeat mode?
(HDTCCTm ¹ 01H)
No
(Normal mode: HMODEm = 0) 1
Read data from transfer Reads data from the address Read data from transfer Reads data from the address
source (SFR) indicated in HDTSARm source (SFR) indicated in HDTSARm
(transfer source address). (transfer source address).
Write data to transfer Writes to the address indicated Write data to transfer Writes to the address indicated
destination (RAM or SFR) in HDTDARm (transfer destination (RAM or SFR) in HDTDARm (transfer
destination address). destination address).
Write back transfer counter, Decrements the transfer Decrements the transfer
Write back transfer counter,
transfer source address, and counter (HDTCCTm) by 1 and transfer source address, and counter (HDTCCTm) by 1 and
transfer destination address updates the transfer source transfer destination address updates the transfer source
address and transfer address and transfer
destination address.Note 1 destination address.Note 1
Note 1. 1 is added for 8-bit transfers and 2 is added for 16-bit transfers.
Remarks i = 0 to 5, m = 0 or 1
Figure 1.1 Flowchart of DTC (High-Speed Transfer) Internal Operation (1/2)
Yes
Interrupts (HRPTINTm = 1)
enabled?
No
(HRPTINTm = 0) Write 0 (activation disabled) to
Disables DTC (high-speed
bit in DTCENi register
transfer) activation.
corresponding to DTC
activation source
Read data from transfer Reads data from the address Read data from transfer Reads data from the address
source (SFR) indicated in HDTSARm (transfer source (SFR) indicated in HDTSARm (transfer
source address). source address).
Write data to transfer Writes to the address indicated in Write data to transfer Writes to the address indicated in
destination (RAM or SFR) HDTDARm (transfer destination destination (RAM or SFR) HDTDARm (transfer destination
address). address).
Write back transfer counter, The value of the transfer count Write back transfer counter, The value of the transfer count
transfer source address, and reload register (HDTRLDm) is transfer source address, and reload register (HDTRLDm) is
transfer destination address transferred to HDTCCTm, and the transfer destination address transferred to HDTCCTm, and the
transfer source address or transfer transfer source address or transfer
destination address selected for the destination address selected for the
repeat area is initialized (the lower repeat area is initialized (the lower
8 bits are set to 00H). 8 bits are set to 00H).
Remarks i = 0 to 5, m = 0 or 1
Figure 1.2 Flowchart of DTC (High-Speed Transfer) Internal Operation (2/2)
VDD VDD
EVDD RESET
VDD
P33/ANI0/AVREFP
RL78/F14
P34/ANI1/AVREFM P80/ANI2
REGC P81/ANI3
Analog input signals
EVSS P82/ANI4
VSS P83/ANI5
In the application described in this document AVREFP, AVREFM, ANI2, ANI3, ANI4, and ANI5 are used.
Figure 2.1 Connection Diagram of Pins Used
TAU00
(Master: 2 ms)
TAU01
Start trigger A/D converter
(INTTM00 signal) A/D conversion ANI2
trigger ANI3
TAU01 (INTTM01 signal) ADCR register
(Transfer source) ANI4
(Slave: 1 ms)
ANI5
2 ms
FFFFH
3E7FH
TCR00
TAU00
(Master)
0000H
INTTM00 signal
(TAU01 start trigger)
1 ms
FFFFH
TCR01
1F3FH
TAU01
(Slave) 0000H
INTTM01 signal
(A/D conversion trigger)
A/D converter state Conversion wait ANI2 ANI3 ANI4 ANI5 Conversion wait ANI2 ANI3 ANI4
DTC (high-speed
transfer) activation
request
ANI2 conversion
FFB00H ANI2 conversion result result
RAM
FFB02H ANI3 conversion result
(Transfer
destination) FFB04H
ANI4 conversion result
FFB06H ANI5 conversion result
ADIF
DTCEN16
[1] The DTCEN16 bit in the DTCEN1 register is set to 1 (DTC (high-speed transfer) activation enabled (source: A/D conversion end)) by software.
Also, bits TS00 and TS01 in the TS0 register are set to 1 (TAU00 and TAU01 start counting) by software.
[2] When TAU01 finishes counting, the INTTM01 signal is output. Also, A/D conversion starts, using this signal as the trigger.
[3] At A/D conversion end, the DTC (high-speed transfer) performs a memory transfer (ADCR register ® RAM). Also, HDTCCT0 is decremented and
the DTC (high-speed transfer) transfer destination address is incremented when the DTC (high-speed transfer) transfer takes place.
[4] When the transfer that causes the value of HDTCCT0 to change from 1 to 0 is executed, the following operations are performed:
• The DTCEN16 bit is cleared to 0 (DTC (high-speed transfer) activation disabled).
• The ADIF bit changes to 1 (generation of A/D conversion end interrupt request at DTC (high-speed transfer) transfer-end).
• A DTC (high-speed transfer) data transfer is performed (ADCR register ® RAM).
• The value of HDTRLD0 is stored in HDTCCT0 (initialization of DTC (high-speed transfer) transfer count).
• 00H is stored in the lower byte in HDTDAR0 (initialization of transfer destination address).
[5] The DTCEN16 bit in the DTCEN1 register is set to 1 (DTC (high-speed transfer) activation enabled (source: A/D conversion end)) by software.
[6] When TAU00 finishes counting, the INTTM00 signal is output (generation of TAU00 interrupt request signal). Also, TAU01 (slave) starts counting.
Start
DI (disable interrupts)
Initialize TAU00 and TAU01 See 3.4, TAU00 and TAU01 Setting Procedure
EI (enable interrupts)
End
Start
Initialize FFD00H to FFDFFH Initializes the DTC control data area and DTC vector table area (00H).
DTCENi = 00H
Disables all DTC activation.
(i = 0 to 5)
HDTRLD0 = 04H Sets the high-speed DTC transfer count (reload) (4 times).
End
Start
End
Note Writing to the DTCEN16 bit should be performed when interrupt sources for which DTC (high-speed
transfer) activation is enabled in the DTCEN1 register, and the interrupt source (A/D conversion end)
set as activation-enabled, will not be generated.
Figure 3.5 Procedure for Enabling Peripheral Functions (DTC (High-Speed Transfer) Transfer Start)
Start
End
Note Writing to the DTCEN16 bit should be performed when interrupt sources for which DTC (high-speed
transfer) activation is enabled in the DTCEN1 register, and the interrupt source (A/D conversion end)
set as activation-enabled, will not be generated.
Figure 3.6 DTC (High-Speed Transfer) Transfer-End Interrupt (A/D Conversion End Interrupt)
Handler
Table 4.1 DTC (High-Speed Transfer) Transfer Clock Cycle Count (Transfer Source: ADCR Register,
Transfer Destination: RAM, Repeat Mode)
Control Data
Vector Read Data Read Data Write Total
Read Write-Back
1 1 1 1 4
Note: See Table 4.2 for the control data write-back clock cycle count, Table 4.3 for the data read clock cycle
count, and Table 4.4 for the data write clock cycle count. The settings used in the example presented
in this document are indicated in Table 4.2 to Table 4.4 by the white unshaded cells.
Table 4.2 Clock Cycle Count Necessary for DTC (High-Speed Transfer) Control Data Write-Back
HDTCCRm Register Settings Address Settings Write-Back Control Registers
Clock
Transfer Transfer
HDAMODm HSAMODm HRPTSELm HMODEm HDTCCTm HDTRLDm HDTSARm HDTDARm Cycles
Source Destination
0 0 X 0 Fixed Fixed Write-back 1
0 1 X 0 Incremented Fixed Write-back Write-back 1
1 0 X 0 Fixed Incremented Write-back Write-back 1
1 1 X 0 Incremented Incremented Write-back Write-back Write-back 1
0 X 1 1 Repeat Fixed Write-back Write-back 1
1 X 1 1 Repeat Incremented Write-back Write-back Write-back 1
X 0 0 1 Fixed Repeat Write-back Write-back 1
X 1 0 1 Incremented Repeat Write-back Write-back Write-back 1
Note: X: 0 or 1, —: no write-back, m = 0, 1
Table 4.3 DTC (High-Speed Transfer) Data Read Clock Cycle Count
Flash Memory SFR
RAM
Code Flash Data Flash 1st SFR 2nd SFR (No Wait) 2nd SFR (Wait)Note
1 1 1 + wait cycle count
Note A wait (1 clock cycle) is necessary when accessing the CAN- and LIN-related registers and the TRJ0
register of timer RJ.
Table 4.4 DTC (High-Speed Transfer) Data Write Clock Cycle Count
Flash Memory SFR
RAM
Code Flash Data Flash 1st SFR 2nd SFR (No Wait) 2nd SFR (Wait)Note
1 1 1 1 + wait cycle count
Note A wait (1 clock cycle) is necessary when accessing the CAN- and LIN-related registers and the TRJ0
register of timer RJ.
Inquiries
http://www.renesas.com/contact/
All trademarks and registered trademarks are the property of their respective owners.