Basic Information Functional Description Application Description Points to Note Others

Basic Information


Functional Description

 


Question 1

What OPA functions can be implemented by OPA0 and OPA1?

Answer

  1. 1. The OPA1 and OPA1 can implement functions such as Inverting Amplifier, Non-inverting Amplifier, Voltage Follower, Non-cascade Amplifier, Cascade Amplifier, Comparator, Schmitt Trigger, Integrators and Differentiators etc.
  2. OPA1 can also implement a PGA (Programmable Gain Amplifier) function.


Question 2

How do I set the PA0, PA1 and PC6 pins to be V+ and V- OPA1 inputs and OPA1 output pins?

Answer

Setting the A1NC, A1PC and A1XC bits to 1 in the COPA3C register will route the OPA1 output to an MCU pin and at the same time disable its original I/O function and pull-high resistor.

COPA3C ( comparator, OPA control register 3)

Bit #

7

6

5

4

3

2

1

0

OPA3C

A1XC

A1PC

A1NC

A0XC

A0PC

A0NC

CPC

CNC

POR

0

0

0

0

0

0

0

0


Question 3

How do I implement a calibration for OPA0 and OPA1?

Answer

Before using the OPA, a V+ and V- offset voltage calibration should be first implemented.

The calibration steps are as follows:

  1. Set AnOFM=1 to setup the offset cancellation mode (S3 is closed.)
  2. et AnRS to select which input pin is to be used as the reference voltage (S1 or S2 is closed.)
  3. Adjust AnOF[3:0] until the output status changes.
  4. Set AnOFM=0 to enter the normal OPA mode.


Question 4

What are the functions of A0PS[2:0] and A1PS[2:0] in the COPA0C and COPA1C registers?

Answer

To select the V+ input source of OPA0 and OPA1 - refer to the following table:

 

A0PS[2:0]
MA0P selection

A1PS[2:0]
MA1P selection

000

A0P pin

A1P pin

001

0.7VDD

0.7VDD

010

0.5VDD

0.5VDD

011

0.1VDD

0.1VDD

100

VSS

VSS

101

-

A0X

110

-

-

111

-

-


Question 5

What is the function of A1G[2:0] in the COPA1C register?

Answer

A1G is used to select the PGA amplifying ratio of OPA1 as the reference as shown in the following table. For the circuit diagram, refer to the 39th page of the datasheet.

A1G[2:0]

R2/R1

000

6.25

001

12.5

010

18.75 

011

25

100

31.25

101

37.5

110

43.75

111

50


Question 6

What is the function of A1NS[2;0] in the COPA1C?

Answer

It is used to select the V- input source for OPA1. Refer to the table below.

 

A1NS[1:0]
MA1N selection

00

A1N pin

01

A0X

10

VSS

11

-


Question 7

How do I setup the register if using OPA0 as an inverting amplifier as shown in figure 1?


Figure 1 Inverting Amplifier Circuit Diagram

Answer

The equivalent circuit of the HT48R066G is as shown in figure 2.


Figure 2 Inverting Amplifier Equivalent Circuit

The relevant register configurations are as follows:


Question 8

How do I setup the relevant register configurations when using OPA0 and OPA1 as a non-inverting cascade amplifier as shown in figure 1?


Figure 1 Nov-inverting Cascade Amplifier Circuit

Answer

The equivalent circuit of the HT48R066G is shown in figure 2 below.


Figure Non-inverting Cascade Amplifier Equivalent Circuit

The relevant register configurations are as follows:


Question 9

How do I setup the relevant register configurations when using OPA0 as an integrator as shown in figure 1?


Figure 1 Integrator Circuit

Answer


Figure 2 Integrator Equivalent Circuit

The relevant register configurations are as follows:


Question 10

How do I set the PC0, PC1 and PC7 pins to have V+ and V- and output comparator functions.?

Answer

Set the CPC, CNC and CXC in the COPA2C and COPA3C registers as 1 to route the comparator output pin to the external MCU and to disable its original I/O function and pull-high resistor.

COPA2C ( comparator, OPA control register 2)

Bit #

7

6

5

4

3

2

1

0

OPA2C

S24

S23

S22

S21

S13

S12

S11

CXC

POR

0

0

0

0

0

0

0

0


COPA3C ( comparator, OPA control register 3)

Bit #

7

6

5

4

3

2

1

0

OPA2C

A1XC

A1PC

A1NC

A0XC

A0PC

A0NC

CPC

CNC

POR

0

0

0

0

0

0

0

0


Question 11

What is the function of CPS[2:0] in the COPA0C register?

Answer

It is used to select the V+ input source of the comparator. See the table below for details.

 

CPS[2:0]
MCP selection

000

CP pin

001

0.7VDD

010

0.5VDD

011

0.1VDD

100

VSS

101

-

110

-

111

-


Question 12

What is the function of CNS[1:0] in the COPA0C register?

Answer

It is used to select the V- input source of the comparator. See the table below for details.

 

CNS[1:0]
MCN selection

00

CN pin

01

A0X

10

VSS

11

-


Question 13

What is the function of CPCS[1:0] in the CMP0C register?

Answer

These two bits in the CPCS register are used to select the operating current of the comparator. The larger the current is, the faster the comparator speed will be. When the operating current of the comparator is selected as 1uA, the comparator will still function in the Halt Mode.


Question 14

What is the function of the A0VRC, A1VRC and CPVRC bits in the CMP1C register?

Answer

When these three bits are set to 1, it means that the V+ reference voltage is to be routed to corresponding I/O pins (A0P, A1P, and CX pins.) By adding an RC filter to the I/O pin, circuit, generated noise can be reduced.


Application Description


Points to Note

 


Question 1

When using the HIRC, if the I/O pin which is shared with OSC1 is to be used as an AC zero crossing detector, will there be any influence on the HIRC oscillation frequency? If yes, which MCUs will be affected and how can this problem be resolved??

Answer

If the HIRC is used and if the I/O pin which is shared with OSC1 is used as an AC zero crossing detector pin, the HIRC oscillation frequency will be influenced.
The affected MCUs are:
All MCUs whose I/O pin is pin-shared with OSC1 (including the enhanced OTP type MCU and Flash type MCU etc.)
How to resolve this issue:
1. Avoid using the I/O pin that is shared with OSC1 as AC zero crossing detector pin.
2. If the problem can still not be resolved, add external circuitry to ensure that the voltage applied on the OSC1 pin remains withing the range of VDD and VSS.


Others