Cypress S6J3110 Series, S6J3119, S6J3118, S6J311A, S6J3120 Series How To Use Manual

...
AN204457
How To Use A/D Converter For S6J3110/ S6J3120 Series
Target Products: Refer to Section 2
Contents
Series
Product Number (Not Included Package Suffix
S6J3110
S6J3118, S6J3119, S6J311A, S6J311B, S6J311C, S6J311D, S6J311E
S6J3120
S6J3128, S6J3129, S6J312A
1 Introduction .................................................................. 1
1.1 About This Document ........................................... 1
2 Target Products ........................................................... 1
3 Overview ...................................................................... 2
3.1 A/D Compare Activation ....................................... 2
3.2 A/D Activation Arbitration Functions ..................... 3
3.3 A/D Converter Control Functions .......................... 3
3.4 Configuration ........................................................ 4
3.5 A/D Converter Setting ........................................... 7
4 Registers .................................................................... 20
4.1 Analog Input Control Register (ADER) ............... 20
4.2 A/D Mode Setting Register (ADMD) ................... 20
4.3 A/D Activation Trigger Extended Control Register
(ADTECS) ........................................................... 20
4.4 A/D Activation Trigger Control Status Register
(ADTCS) ............................................................. 21
4.5 A/D Activation Trigger Control Status Clear
Register (ADTCSC)…………………………….21

1 Introduction

1.1 About This Document

This application note is intended for persons who are considering the use of Traveo family S6J3110 / S6J3120 series. This application note describes an example of setting for basic A/D Converter function and Range Compare function
in the S6J3110 / S6J3120 Series.
4.6 Range Comparison Control Status Register (ADRCCS)………………………………………. 22
4.7 Upper Threshold Setting Register (ADRCUT) .. 22
4.8 Lower Threshold Setting Register (ADRCLT) ... 22
4.9 A/D Software Activation Channel Selection
Register (ADTSE) ............................................. 23
4.10 A/D Software Activation Register (ADTSS) ....... 23
4.11 A/D Data Register (ADTCD) ............................. 23
4.12 Range Comparison Flag Register (ADRCIF) .... 24
4.13 Range Comparison Flag Clear Register
(ADRCIFC) ....................................................... 24
5 Reference .................................................................. 25
Document History ............................................................ 26
Worldwide Sales and Design Support ............................. 27
Products .......................................................................... 27
PSoC® Solutions ............................................................. 27
Cypress Developer Community....................................... 27
Technical Support ........................................................... 27

2 Target Products

Products of what is described in this operation manual are as follows.
www.cypress.com Document No. 002-04457 Rev. *B 1

3 Overview

This section explains an overview of the 12-bit A/D converter. The 12-bit A/D converter has the function of converting analog input voltage into a 12-bit digital value by RC
successive approximation conversion system. And this section explains the range comparison function. Range comparison function detects digital value of inside and outside by upper and lower threshold registers settings.

3.1 A/D Compare Activation

The function of A/D activation compare is explained.

3.1.1 Analog Input Control

This A/D converter includes 2 converter units, and can enable or disable each of up to 64 channels of analog input.

3.1.2 Activation Channel

It performs operation for A/D activation request control and A/D conversion data storage with each activation channel. The A/D activation channel corresponds to each unit of 12-bit A/D converter. The correspondence is as follows.
Activation channels 0-31: 12-bit A/D converter unit 0 Activation channels 32-63: 12-bit A/D converter unit 1

3.1.3 A/D Activation Request

Each activation channel issues an A/D activation request by one of the following methods.
Software Base timer (Reload timer, PWM timer compare match) Free-run timer compare match
For software activation, reload timer activation, and PWM timer activation, an arbitrary activation channel can be selected. For compare match activation, the A/D activation is requested when the value in the free-run timer and the compare register of each activation channel match.
For an activation request, either single mode or repeat mode can be set for each activation channel. In single mode, an activation factor causes an activation request. In repeat mode, an activation factor causes a continuous activation request.
How to Use A/D Converter for S6J3110/ S6J3120 Series

3.1.4 A/D Conversion Data

When A/D conversion is completed, the converted data is stored in the A/D data register. Each activation channel is equipped with an A/D data register. Each A/D data register contains an error flag bit and error status bit. The status of the A/D-converted data can be learned from the values of these bits.

3.1.5 Scan Conversion with the A/D Conversion Count Specified

Scan conversion with the A/D conversion count specified can be performed for each activation channel. 1 type of scan conversion with the A/D conversion count specified can be specified for each 12-bit A/D converter unit.
As the specification of an A/D conversion count, a number from 1 to 4 can be selected.

3.1.6 Range Comparison Function

The range comparison can be compared for each activation channel.
Up to 4 types of upper and lower threshold settings can be made. Each activation channel selects 1 combination
from among the 4 types.
Inside or Outside detection can select in the upper and lower thresholds. Continuous detection count function. (Detection count can select from 1 to 7.)

3.1.7 Interrupt Request

Each activation channel can generate an interrupt request when the A/D conversion is completed.

3.1.8 Data Protection Function

For each A/D data register, the data protection function can be set. The protection function is effective for factors that are not compare match activation. When the data protection function is enabled, the A/D activation request is masked until data is read from the A/D data register and the interrupt flag is cleared.
www.cypress.com Document No. 002-04457 Rev. *B 2

3.1.9 Failure Diagnosis Function

The 12-bit A/D converter has a failure diagnosis function. The AVRH and AVRL voltage conversion diagnosis. This product has the function of fixing the input voltage level of the internal A/D converter to the AVRH or AVRL level
and perform A/D conversion.

3.2 A/D Activation Arbitration Functions

The A/D activation arbitration for each 12-bit A/D converter unit.
The A/D activation arbitration consists of the arbitration circuit, A/D activation trigger generation, and analog
channel number selection.
The A/D activation arbitration arbitrates an activation request from the A/D activation compare and generates
the activation trigger, A/D conversion cancellation signal, and analog channel number.
The A/D activation arbitration selects one from among the activation requests from different A/D activation
compares to generate the activation trigger. The A/D activation arbitration performs priority control when activation requests from different A/D activation compares conflict with each other. The priority orders are determined according to the following rules.
When an activation factor with the same priority order occurs while A/D conversion is stopped:
The activation factor with the smaller activation channel number is processed first.
When an activation factor with a different priority order occurs while A/D conversion is stopped:
The activation factor with the higher priority order is processed first.
When an activation factor with a higher priority order occurs while A/D conversion is in progress:
The current conversion is interrupted, and the activation factor with the higher priority order is processed. Arbitration is performed again after this conversion, and then the processing of the interrupted activation factor is restarted.
When an activation factor with a lower priority order occurs while A/D conversion is in progress:
Arbitration is again performed after the current conversion is completed, and then the activation factor with the lower priority order is processed.
When an activation factor with the same priority order occurs while A/D conversion is in progress:
Arbitration is again performed after the current conversion is completed, and then the activation factor with the same priority order is processed.
How to Use A/D Converter for S6J3110/ S6J3120 Series

3.3 A/D Converter Control Functions

This section explains the functions of the 12-bit A/D converter control. A function for A/D-converting the analog voltage that is input to the analog input pin (input voltage) into a digital value is supported and it has the following features.
The conversion system used is an RC successive approximation conversion system with a sample hold circuit. The analog input pin can be selected by the registers (make its setting in the A/D activation compare block). 1 sequence of A/D conversion is performed in response to 1 activation factor. If another activation signal is input during A/D conversion, reactivation is performed. (Reactivation function) If the A/D conversion cancellation signal is received during A/D conversion, the current processing is stopped and
initialized. (Forcible stop function)
For setting the sampling time, the sampling time setting that is common to all the channels or sampling time
setting for each channel can be selected.
www.cypress.com Document No. 002-04457 Rev. *B 3

3.4 Configuration

This section shows the configuration of the 12-bit A/D converter.

3.4.1 Configuration of the A/D Activation Compare

The configuration of the A/D activation compares shows in the following.
Figure 1. Configuration of the A/D Activation Compare (n=31, A/D Converter Unit 0)
How to Use A/D Converter for S6J3110/ S6J3120 Series
www.cypress.com Document No. 002-04457 Rev. *B 4

3.4.2 Configuration of the A/D Activation Arbitration

The configuration of the A/D activation arbitration shows in the following.
Figure 2. Configuration of the A/D Activation Arbitration
How to Use A/D Converter for S6J3110/ S6J3120 Series
www.cypress.com Document No. 002-04457 Rev. *B 5

3.4.3 Configuration of the 12-Bit A/D Converter Control

The configuration of the A/D Converter Control shows in the following.
Figure 3. Configuration of the 12-Bit A/D Converter Control (n=32, A/D Converter Unit 0)
How to Use A/D Converter for S6J3110/ S6J3120 Series
www.cypress.com Document No. 002-04457 Rev. *B 6
A/D Converter time setting
Activation channel and factor
setting
Range comparison function
setting
A/D Converter Start setting
End
Analog input enable setting
A/D Converter setting start
- A/D Converter end interrupt setting
-Range Comparison interrupt setting
Interrupt setting
End

3.5 A/D Converter Setting

3.5.1 Example of Settings

Example of the A/D Converter setting flow shows in the following. And setting items shows in the Figure4.
How to Use A/D Converter for S6J3110/ S6J3120 Series
Figure 4. A/D Converter Function Example of Settings
www.cypress.com Document No. 002-04457 Rev. *B 7
Table 1. A/D Converter Function Example of Setting Items
Setting item
Setting value
Analog input pin
AN14
Sampling time
1.3µs
Compare time
0.8µs
Activation channel
Channel 0
Activation factor
Software
A/D Converter mode
Repeat conversion
A/D Converter protection
Disable
A/D Conversion Completion interrupt
Enable
A/D Range Comparison function
Enable
A/D Range Comparison interrupt
Enable
Each item (Figure 4) of the setting flow describes in the following.
How to Use A/D Converter for S6J3110/ S6J3120 Series
www.cypress.com Document No. 002-04457 Rev. *B 8
Analog input pin setting (AN14) ADER_ADER0=0x00004000
ADER register key code setting
Analog inputs enable setting
End
3.5.1.1 Analog Input Enable Setting The analog input enable setting uses Analog Input Control Register (ADER). This register is target of the Key Code
Register. (Please refer to the "4.1.1.Key Code Register" of the CHAPTER: 12 Bit-A/D Converter in the S6J3110 / S6J3120 Series Hardware Manual.) This application note setting is AN14 in the analog input pin.
How to Use A/D Converter for S6J3110/ S6J3120 Series
Figure 5. Analog Input Enable Setting Flow
www.cypress.com Document No. 002-04457 Rev. *B 9
Loading...
+ 18 hidden pages