- SS-HQ1 Application Notes -
Ver.1.0.0 January 7, 2005
77
To control a multi-bit parameter with the port driver
(Example 2)
Assign the 8-bit wide parameters of PGPAT (CAT2_Byte37_bit0-7) to P1 of the port driver. From High or
Low input to P1 (Pin 92), change the GAIN value of RYGAIN1.
• Port input (Low) :
RYGAIN1=3Fh setting
(CAT2_Byte37_bit0-7 = 3F[h])
• Port input (High) :
RYGAIN1=5Fh setting
(CAT2_Byte37_bit0-7 = 5F[h])
* At first, set the value of RYGAIN1 to 3Fh and write to EEPROM.
(The setting value in case a port input is Low)
[Parameter Setting Details]
P1ADJ = B[h] (
*1
)
P1WID = 7[h] (RYGAIN1 is 8-bit parameter. Thus,P1WID is set as 7[h].)
P1Byte = 25
[
h
]
(RYGAIN1 is the parameter of 37th Byte of CAT2. Thus,P1Byte is set as 25[h].)
* Parameter value is set up by hex decimal.
Thus, it changes into 36d from 24[h].
P1IOSEL= 0[h] (P1 is set as an input. Thus,P1IOSEL is set as 0[h].)
P1CAT = 2[h] (RYGAIN1 is the parameter of CAT2. Thus,P1CAT is set as 2[h].)
P1LSB = 0[h] (LSB of RYGAIN1 is the 0th bit. Thus,P1LSB is set as 0[h].)
*1
The P1ADJ setting
The parameter value is 1.5 times of value written to EEPROM. Thus, use the following formula.
(Formula) Parameter value = Value written to EEPROM × (P1ADJ Value + 1) / 8
= 3F[h] × (B[h] + 1) / 8
= 63[d] × (11[d]+1) / 8
= 94.5[d] (The operation result is rounded off by Rounding-off processing.)
= 95[d] (5F[h])
Fig 10.1-3 SETTING IMAGE
■
CAT (P2CAT=9[h])
CAT5
CAT6
CAT7
CAT8
CAT9
CAT10
CAT11
■
Byte (P2BYTE=25[h])
Byte34
Byte35
Byte36
Byte37
Byte38
Byte39
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
■
bit (P2LSB=0[h])
LSB(P2LSB=0[h])
P2WID=1[h]
(P2WID=1[h])
(
CAT9_Byte37_bit0-1 = 1[h]
)
(
CAT9_Byte37_bit0-1 = 3[h]
)
PortInput=Low
PortInput=High