Chapter 16 D/A Converter

16-4 Setup Example

„Channel fixed D/A Converter Setup Example Conversion channel should be set to DA0.

An example setup procedure, with a description of each step is shown below.

 

Setup Procedure

 

Description

 

 

 

 

(1)

Set the port A pin.

(1)

Set the analog output pin (set at the procedure 2),

 

PAIMD (x'3F3C')

 

as the specfical function pin by the port A input

 

bp0 : PAIMD0 = 1

 

mode register (PAIMD). Also, set to "input mode"

 

PADIR (x'3F3A')

 

by the port A I/O direction control register

 

bp0 : PADIR0 = 0

 

(PADIR), and to "no pull-up resistance" by the

 

PAPLUD (x'3F4A')

 

port A pull-up resistance control register

 

bp0 : PAPLUD0 = 0

 

(PAPLUD).

(2)

Set the D/A conversion pin.

(2)

Set PA0 to D/A output pin by the DACH1-0 flag of

 

DACTR (x'3FBE')

 

the D/A converter control register (DACTR).

 

bp1-0 : DACH1-0 = 01

 

 

(3)

Set the D/A converter input data.

(3)

Set the D/A conversion data by the D/A converter

 

DADR01(x'3FBF')

 

input register01 (DADR01).

(4)

Start thte D/A conversion.

(4)

Set the DABUSY flag of the D/A converter control

 

DACTR(x'3FBE')

 

register (DACTR) to"1" to start the D/A

 

bp2 : DABUSY = 1

 

conversion. The result is output to the DA3-DA0.

 

 

 

 

Note : The above (1) to (2) can be set at once.

Setup Example

XVI - 7

Page 499
Image 499
Panasonic F77G, MN101C77C user manual Setup Example, Paplud