W78E378/W78C378/W78C374: General Description
W78E378/W78C378/W78C374: General Description
MONITOR MICROCONTROLLER
GENERAL DESCRIPTION
The W78E378, W78C378 and W78C374B are ASIC which is a stand-alone high-performance
microcontroller specially designed for monitor control applications. The device integrates the
embedded 80C31 microcontroller core, on-chip Flash EPROM or Mask ROM, 576 bytes of RAM, and a
number of dedicated hardware monitor functions. Additional special function registers are incorporated
to control the on-chip peripheral hardware. The chip is used to control the interface signal of other
devices in the monitor and to process the video sync signals. Because of the highly integration and
Flash cell for program memory, the device can offer users the competitive advantages of low cost and
reduced development time.
FEATURES
• 80C31 MCU Core Embedded
• 32K Bytes Flash EPROM(W78E378)
• 32K Bytes Mask-ROM (W78C378)
• 16K Bytes Mask-ROM (W78C374B)
• Total 576 Bytes of On-chip Data RAM
− 256 bytes accessed as in the 80C32
− 320 bytes accessed as external data memory via "MOVX @Ri"
• PWM DACs
− Eight 8-bit Static PWM DACs: DAC0−DAC8
− Three 8-bit Dynamic PWM DACs: DAC9−DAC10
• Sync Processor
− Horizontal & Vertical Polarity Detector
− Sync Separator for Composite Sync
− 12-bit Horizontal & Vertical Frequency Counter
− Programmable Dummy Frequency Generator
− Programmable H-clamp Pulse Output
− SOA Interrupt
− Hsync/2 Output
• Serial Ports:
− DDC1 Port- support DDC1
− SIO1 & SIO2 Ports - each can support DDC2B/2B+/2Bi/2AB (each has 2 slave addresses)
• Two 16-bit Timer/Counters (8031's Timer0 & Timer1)
• One External Interrupt Input (8031's INT0 )
• One Parabola Interrupt Generator
• One ADC with 7 Multiplexed Analog Inputs
• Two 12 mA(min) Output Pins for Driving LEDs
22
• Watchdog Timer (2 /Fosc = 0.42s @Fosc = 10 MHz)
• Power Low Reset
• Frequency: 10 MHz max. (with the same performance as a normal 8051 that uses 20 MHz)
• Packaged in 40/32-pin 600 mil DIP & 44-pin PLCC
PIN CONFIGURATIONS
40-pin DIP: W78E378E 40-pin DIP
44-pin PLCC
P P P P P P P P P P P
3 1 1 3 4 4 4 4 3 1 1
. . . . . . . . . . .
4 0 1 5 0 1 2 3 6 2 3
6 5 4 3 2 1 4 4 4 4 4
4 3 2 1 0
P3.3 7 39 P1.4
H IN 8 38 NC
VIN 9 37 P1.5
RESET 10 36 P1.6
W78E378P
VDD 11 35 P1.7
W78C378P
VDDA 12 34 P2.0
VDD 13 W78C374P 33 P2.1
VSSA 14 32 P2.2
OSCOUT 15 31 P2.3
OSCIN 16 30 P2.4
P3.2 17 1 1 2 P2.5
2 2 2 2 2 2 2 2 29
8 9 0 1 2 3 4 5 6 7 8
P P V V P P P P P P P
3 3 S S 4 4 4 4 3 2 2
. . S S . . . . . . .
1 0 7 6 5 4 7 7 6
-2-
W78E378/W78C378/W78C374
PIN DESCRIPTION
PIN NAME I/O DESCRIPTION
RESET I/O Chip reset input (active low) input &
Internal reset output (generated by WDT or power low)
TTL Schmitt trigger input, internal pull-up ~30 KΩ
IOL = +12 mA @VOL = 0.45V
VDD - Positive power supply
VSS - Ground
VSS - Ground
OSCOUT O Output from the inverting oscillator amplifier
OSCIN I Input to the inverting oscillator amplifier, 10 MHz max.
HIN I Hsync input
TTL Schmitt trigger input , w/o PMOS
VIH/VIL = 2.0V/0.8V, V+/ V- = ~1.6V/ 1.1V
VIN I Vsync input
TTL Schmitt trigger input, w/o PMOS
VIH/VIL = 2.0V/0.8V, V+/ V- = ~1.6V/ 1.1V
P1.0 (DAC0) I/O General purpose I/O, DAC0 special function output
Open-drain output, sink current: 15 mA
P1.1 (DAC1) I/O General purpose I/O, DAC1 special function output
Open-drain output, sink current: 15 mA
P1.2 (DAC2) I/O General purpose I/O, DAC2 special function output
Open-drain output, sink current: 4 mA
P1.3 (DAC3) I/O General purpose I/O, DAC3 special function output
Open-drain output, sink current: 4 mA
P1.4 (DAC4) I/O General purpose I/O, DAC4 special function output
Open-drain output, sink current: 4 mA
P1.5 (DAC5) I/O General purpose I/O, DAC5 special function output
Open-drain output, sink current: 4 mA
P1.6 (DAC6) I/O General purpose I/O, DAC6 special function output
Open-drain output, sink current: 4 mA
P1.7 (DAC7) I/O General purpose I/O, DAC7 special function output
Open-drain output, sink current: 4 mA
-4-
W78E378/W78C378/W78C374
BLOCK DIAGRAM
VDD VSS
Note: freq2
freq1 = freq2 CPU
OSCIN freq1
Osc. Interrupt INT0 (P3.2)
OSCOUT Circuit Processor
Timer 0 T0 (P3.5)
RESET Reset Timer 1 T1 (P3.6)
Circuit
P1, P2, P3
Power Low I/O Port
Detection
P4
Note:
P1, P4.4~P4.5
P3.0~P3.1 & P3.5~P3.7
Watch Dog are open-drain.
Timer
SCL (P3.1)
VPP (P3.2) Program Memory
SIO1 SDA (P3.0)
HIN, VIN
HFI (P4.0)
Sync.
VOUT (P3.4) Processor Static DACs DAC0~7 (P1.0~P1.7)
HOUT (P3.3)
Hclamp (P2.3)
HFO (P4.7)
ADC0 (P2.4)
ADC1 (P2.5) Dynamic DACs DAC8~10 (P2.0~P2.2)
ADC2 (P2.6)
ADC3 (P2.7) ADC
ADC4 (P3.5)
ADC5 (P3.6)
ADC6 (P3.7) 8-bit Internal Bus
-6-
W78E378/W78C378/W78C374
FUNCTIONAL DESCRIPTION
Address Space
7FFFh
(3FFFh) Internal
Program Memory
* Modified PCON
BIT NAME FUNCTION
0 ADCS2 ADC channel Select bit 2
1 PD Power Down bit
2 GF0 General purpose flag bit
3 GF1 General purpose flag bit
4 TEST0 Test purpose flag bit
5 TEST1 Test purpose flag bit
6 ADCcal Set 0/1 to select 1.0V/3.0V for ADC calibration
7 CPUhalt Set to let CPU halt when the chip runs internally
-8-
W78E378/W78C378/W78C374
- 10 -
W78E378/W78C378/W78C374
- 12 -
W78E378/W78C378/W78C374
- 14 -
W78E378/W78C378/W78C374
C/T = 0
To TL0
C/T = 1
T0 pin
(P3.5)
TR0
GATE
INT0 pin
(P3.2)
C/T = 0
To TL1
C/T = 1
T1 pin
(P3.6)
TR1
GATE
DDC Port
IN
SIO1 SCL
SCL
OUT
IN
SDA
SDA
OUT
0
Support DDC2B/2B+
1
DDC1 OUT
SDA
SCL Vsync
Support DDC1
ENDDC1
SCLINT interrupt is generated when SCL (P3.1) has a high-to-low transition and then keeps at low for
16 × 1/Fosc.
Fosc 8 MHz 10 MHz
SCL low 2 µS 1.6 µS
2. SIO2 port:
• To support DDC2B/2B+/2Bi/2AB, use P4.4 (SCL) for serial clock and P4.5 (SDA) for serial data.
DDC1 Port
The DDC1 is a serial output port that supports DDC1 communication. To enable the DDC1 port,
ENDDC1 (bit 3 of CTRL1) should be set to '1'. Once previous eight data bits in the shift register and
one null bit (the 9th bit) are shifted out to the SDA sequentially on each rising edge of the VIN signal,
the DDC1 control circuit loads the next data byte from the latch buffer (the DDC1 register) to the shift
register and generates a DDC1INT signal to the CPU. In the interrupt service routine, the S/W should
fetch the next byte of EDID data and write it to the DDC1 register. If ENDDC1 is cleared, the shift
register is stopped, and the SDA output is kept high. The bit DDC1B9 (bit 4 of CTRL2) decides the 9th
bit in a DDC transmission. If DDC1B9 is set, the 9th bit will be '1', otherwise '0'.
- 16 -
W78E378/W78C378/W78C374
To use DDC1 port, a user should pay attention to the following items:
(1) When the chip is powered-on or after reset , the 8-bit shift register in DDC1 H/W contains all 0s. If
you write a data to the latch buffer (the DDC1 register), it will be loaded to the shift register at the
9th clock (on VIN), so from the 10th clock, the real data bit begins to shift out.
(2) Because there is no reset signal to the latch buffer, it contains a random data after power-on. If you
enable DDC1 without writing data to the latch buffer, SDA will have the random data shifted out
after 9 clocks. The shift register is reset to 00H during CPU reset.
(3) The DDC1 H/W has a counter that counts how many bits shifted out. This counter is initialized to 0
when power-up or reset. When you firstly enable DDC1 after power-on, the first bit is already shifted
out without clock, so the first clock triggers the second data bit (D6) to shift out and "0000 0001 1"
will be got. After the first 9 clocks that shift out an invalid byte, the counter counts from 1 to 9
cyclically according to the clock pulse on VIN-pin. See the following illustration.
(4) The interrupt happens on the failing edge of the following first clock. The next data, which is about
to be shifted out, in the latch buffer is loaded into the shift register at the rising edge of the following
first clock. At the same time, data bit D7 is shifted out and the counter value is "1".
Operation of SIO1 Port: (SIO2 has the same function except their addresses of control registers)
a) Control Registers
a-1) The Address Registers, S1ADR1, S1ADR2
The SIO1 is equipped with two address registers: S1ADR1 & S1ADR2. The CPU can read from and
write to these two 8-bit, directly addressable SFRs. The content of these registers are irrelevant when
SIO1 is in master modes. In the slave modes, the seven most significant bits must be loaded with the
MCU's own address. The SIO1 hardware will react if either of the addresses is matched.
7 6 5 4 3 2 1 0
X X X X X X X -
|------------------------ Own Slave Address -----------------------|
- 18 -
W78E378/W78C378/W78C374
b) Operating Modes
The four operating modes are: Master/Transmitter, Master/Receiver, Slave/Transmitter and
Slave/Receiver. Bits STA, STO and AA in S1CON decide the next action the SIO1 hardware will take
after SI is cleared. When the next action is completed, a new status code in S1STA will be updated
and SI will be set by hardware in the same time. Now, the interrupt service routine is entered (if the
SI_interrupt is enabled), the new status code can be used to decide which appropriate service routine
the software is to branch. Data transfers in each mode are shown in the following figures.
*** Legend for the following four figures:
- 20 -
W78E378/W78C378/W78C374
08H
A START has been
transmitted.
(STA,STO,SI,AA)=(0,0,0,X)
SLA+W will be transmitted;
ACK bit will be received.
18H
SLA+W has been transmitted;
ACK has been received.
or
20H
SLA+W has been transmitted;
NOT ACK has been received.
or
30H
Data byte in S1DAT has been transmitted;
NOT ACK has been received.
(STA,STO,SI,AA)=(0,0,0,X)
SLA+R will be transmitted; 38H
ACK bit will be received;
SIO1 will be switched to MST/REC mode. Arbitration lost in SLA+R/W
or Data bytes.
To Master/Receiver (A)
(STA,STO,SI,AA)=(0,0,0,X) (STA,STO,SI,AA)=(1,0,0,X)
I2C bus will be released; A START will be transmitted when
Not addressed SLV mode will be entered. the bus becomes free.
08H
A START has been
transmitted.
(STA,STO,SI,AA)=(0,0,0,X)
SLA+R will be transmitted;
ACK will be received.
48H 40H
SLA+R has been transmitted; SLA+R has been transmitted;
NOT ACK has been received. ACK has been received.
(STA,STO,SI,AA)=(0,0,0,0) (STA,STO,SI,AA)=(0,0,0,1)
Data byte will be received; Data byte will be received;
NOT ACK will be returned. ACK will be returned.
58H 50H
Data byte has been received; Data byte has been received;
NOT ACK has been returned. ACK has been returned.
38H (STA,STO,SI,AA)=(0,0,0,X)
SLA+W will be transmitted;
Arbitration lost in NOT ACK bit. ACK will be received;
SIO1 will be switched to MST/TRX mode.
(STA,STO,SI,AA)=(1,0,0,X) (STA,STO,SI,AA)=(0,0,0,X)
To Master/Transmitter (B)
A START will be transmitted I2C bus will be released;
when the bus becomes free. Not addressed SLV mode will be entered.
- 22 -
W78E378/W78C378/W78C374
A8H
Own SLA+R has been received;
ACK has been returned.
or
B0H
Arbitration lost in SLA+R/W as master;
Own SLA+R has been received;
ACK has been returned.
(STA,STO,SI,AA)=(0,0,0,0) (STA,STO,SI,AA)=(0,0,0,1)
Last data byte will be transmitted; Data byte will be transmitted;
ACK will be received. ACK will be received.
(STA,STO,SI,AA)=(0,0,0,0) (STA,STO,SI,AA)=(0,0,0,1)
Last data byte will be transmitted; Data byte will be transmitted;
ACK will be received. ACK will be received.
Enter NAslave
`
Send a START
when bus becomes free
60H
Own SLA+W has been received;
ACK has been returned.
or
68H
Arbitration lost in SLA+R/W as master;
Own SLA+W has been received;
ACK has been returned.
(STA,STO,SI,AA)=(0,0,0,0) (STA,STO,SI,AA)=(0,0,0,1)
Data byte will be received; Data byte will be received;
NOT ACK will be returned. ACK will be returned.
88H 80H
Previously addressed with own SLA address; Previously addressed with own SLA address;
Data has been received; Data has been received;
NOT ACK has been returned. ACK has been returned.
Enter NAslave
`
Send a START
when bus becomes free
- 24 -
W78E378/W78C378/W78C374
The conversion of the ADC is started by setting bit ADCSTRT in CTRL1 by software. When the
conversion is completed, the ADCSTRT bit is cleared by hardware automatically, and the ADCINT bit
in INTVECT is set by hardware at the same time if MADCINT in INTMSK is set.
PWM DACs
Eight 8-bit Static DACs: DAC0−DAC7
• The PWM frequency FPWM = Fosc ÷ 255
• The duty cycle of the PWM output = Register value ÷ 255
• The DC voltage after the low pass filter = VCC × duty cycle
Static DAC application circuit:
Low-pass filter
C
T = RC
VOUTPUT = VCC¡Ñn/255, if T >>
T PWM
470
+Vsync 470
470
0.022u
100K 10u/50V
Dynamic DAC Voutput
VDD
10K
4.7u/16V 10K
1. H size distortion:
b. Trapezoid (Keystone)
25%
25%
c. CBOW (Quarter Width)
e. S Curve
2. H center distortion:
c. Corner balance
- 26 -
W78E378/W78C378/W78C374
Sync Processor
Polarity Detector
The H/V polarity is detected automatically and can be known from HPOL bit (HFCOUNTH.7) and
VPOL bit (VFCOUNTH.7).
Fosc 10 MHz
Max. H+V width (64/Fosc) × 62 (counter overflow) = 396.8 µS
Max. V width (2048/Fosc) × 2 = 409.6 µS
Sync Separator
The Vsync is separated from the composite sync automatically, without any software effort.
Fosc 10 MHz
Min. V width & Max. H width (1/Fosc) × 64 = 6.4 µS
V frequency:
The resolution of V frequency counter: VRESOL = (1/Fosc) × 64.
The V frequency: VFREQ = 1/(VCOUNT × VRESOL).
The lowest V frequency can be detected: Fosc ÷ 262144. (38.1Hz @Fosc =10 MHz)
H frequency:
The resolution of H frequency counter: HRESOL = (1/Fosc) ÷ 8.
The H frequency: HFREQ = 1/(HCOUNT × HRESOL).
The lowest H frequency can be detected: Fosc ÷ 512. (19.5 KHz @Fosc = 10 MHz)
VDUMS 0 1
FdummyV FdummyH/ 512 FdummyH/1024
Vsync width 8/ FdummyH 16/ FdummyH
1/FdummyH
Hsync width
1/FdummyV
Hsync Hsync
Hclamp Hclamp
(Leading-edge) (Leading-edge)
Hclamp
Hclamp (Trailing-edge)
(Trailing-edge)
- 28 -
W78E378/W78C378/W78C374
Function description:
• If the condition, HFREQ lower than the lower boundary freq. or higher than the upper boundary freq.,
happens twice continuously, the SOAINT will be activated.
• If the HIN is stopped for a certain period, the SOAINT will also be generated.
The no Hsync response time is 512/FOSC. (e.x., 51.2us for 10 MHz)
• If SOAHDIS = 1, then no upper boundary frequency.
HFI
HFO
(HFO_HALF=0)
(HF_POL=1)
HFO
(HFO_HALF=0)
(HF_POL=0)
HFO
(HFO_HALF=1)
Interrupts
The five interrupt sources are listed as below.
SOURCE VECTOR ADDRESS DESCRIPTON PRIORITY WITHIN A LEVEL
1 IE0 0003H Interrupt 0 edge detected Highest
2 TF0 000BH Timer 0 overflow
*1
3 IE1 0013H Miscellaneous interrupts
4 TF1 001BH Timer 1 overflow
5 SI1+SI2 002BH SIO1 or SIO2 interrupt Lowest
Note: *1: SCLINT + ADCINT + DDC1INT + SOAINT + VEVENT + PARAINT.
The miscellaneous interrupts at vector address 0013H is driven by the following six sources, which are:
(1) SCLINT: when high-to-low transition on SCL-pin,
(2) ADCINT: when A-to-D conversion completion,
(3) DDC1INT: when DDC1 data byte transmitted (after 9 clock pulses from VIN) in the DDC port,
(4) SOAINT: when SOA activated,
(5) VEVENT: on every Vsync pulse or vertical frequency counter overflow,
(6) PARAINT: when parabola timer timeout.
If IE1 interrupt occurs, it is necessary for the programmer to read the INTVECT register to tell where
the interrupt request comes. These sources can be masked individually by clearing their corresponding
bits in the INTMSK register. To clear any of these interrupt flags, just write a '1' to the corresponding bit
in the INTCLR.
The interrupt enable bits and priority control bits for these five main sources are listed as below.
- 30 -
W78E378/W78C378/W78C374
Vector Address IE IP
High Priority
IE0 0003H Low Priority
IE.0 IP.0
TF0 000BH
IE.1 IP.1
Interrupt Polling
Sequence
0013H
IE1 IP.2
IE.2
TF1 001BH
IE.3 IP.3
SI1+SI2 002BH
IE.5 IP.5
IE.7
INTMSK INTVECT
Bit 0
SCL Interrupt 0 SCLINT
Bit 1
ADC Interrupt 1 ADCINT
Bit 2
DDC1 Interrupt 2 DDC1INT 0
SOA Interrupt
Bit 3 IT1 IE1
3 SOAINT
Bit 4 1
VEVENT Interrupt 4 VEVENT
Bit 5
PARA Interrupt 5 PARAINT
4.3V
3.8V
1.8V
VCC
10uS
Power-low Reset
The purpose of a watchdog timer is to reset the CPU if the user program fails to reload the watchdog
timer within a reasonable period of time known as the "watchdog interval". The clock source of the
watchdog timer comes from the internal system clock. It can be enabled/disabled by set/clear WDTEN
(bit 5 of CTRL2). For debug purpose, if the WDT reset or power low reset occur, the RESET pin
will be pulled low internally. The pulled-low duration due to WDT reset is about 60/Fosc sec. The block
diagram of the reset circuitry is shown as below.
R:100K /RESET
C:0.01u
Watchdog Reset Logic
Timer
EN
WDTEN
External Reset
Power-low
Supervisor
Iol=12mA @Vol=0.45V
- 32 -
W78E378/W78C378/W78C374
ELECTRICAL CHARACTERISTICS
Absolute Maximum Ratings
D.C. Characteristics
VDD-VSS= 5V ± 10%, TA = 25°C, Fosc = 10 MHz, unless otherwise specified.
- 34 -
W78E378/W78C378/W78C374
ADC value
B
X
Usable range
(is linear)
After finding these N predicted ADC values, the S/W can recognize which key is pressed by comparing
the ADC value of this key with the set of predicted values (found previously).
** Note: To get the exact on-chip calibration voltages (0.948V and 2.924V), the VDD should be 5.0V as close as possible.
25
20
ADC value
0.8
Usable range
248
3.2
4.4
- 36 -
W78E378/W78C378/W78C374
PACKAGE DIMENSIONS
32-pin P-DIP
A1 0.010 0.25
a 0 15 0 15
S 0.085 2.16
1 16
Notes:
S E
1. Dimensions D Max. & S include mold flash or
c tie bar burrs.
2. Dimension E1 does not include interlead flash.
A A2 A1 Base Plane 3. Dimensions D & E1 include mold mismatch and
are determined at the mold parting line.
L Seating Plane 4. Dimension B1 does not include dambar
protrusion/intrusion.
B
e1
5. Controlling dimension: Inches
a eA
B1
6. General appearance spec. should be based on
final visual inspection spec.
40-pin DIP
A1 0.010 0.254
a 0 15 0 15
1 20
S 0.090 2.286
Notes:
E 1. Dimension D Max. & S include mold flash or
S
c tie bar burrs.
2. Dimension E1 does not include interlead flash.
A A2 A1 Base Plane
3. Dimension D & E1 include mold mismatch and
are determined at the mold . parting line.
L Seating Plane
4. Dimension B1 does not include dambar
protrusion/intrusion.
B
e1 eA 5. Controlling dimension: Inches.
a
B1
6. General appearance spec. should be based on
final visual inspection spec.
44-pin PLCC
HD
D
6 1 44 40 Dimension in inches Dimension in mm
Symbol Min. Nom. Max.
Min. Nom. Max.
7 39 A 0.185 4.70
A1 0.020 0.51
A2 0.145 0.150 0.155 3.68 3.81 3.94
b1 0.026 0.028 0.032 0.66 0.71 0.81
b 0.016 0.018 0.022 0.41 0.46 0.56
E HE GE c 0.008 0.010 0.014 0.20 0.25 0.36
D 0.648 0.653 0.658 16.46 16.59 16.71
E 0.648 0.653 0.658 16.46 16.59 16.71
e 0.050 BSC 1.27 BSC
17 29 GD 0.590 0.610 0.630 14.99 15.49 16.00
GE 0.590 0.610 0.630 14.99 15.49 16.00
18 28
c
HD 0.680 0.690 0.700 17.27 17.53 17.78
HE 0.680 0.690 0.700 17.27 17.53 17.78
L 0.090 0.100 0.110 2.29 2.54 2.79
y 0.004 0.10
L Notes:
A2 A 1. Dimension D & E do not include interlead flash.
2. Dimension b1 does not include dambar
θ protrusion/intrusion.
e b A1
b1
3. Controlling dimension: Inches
Seating Plane y
4. General appearance spec. should be based
GD on final visual inspection spec.
Headquarters Winbond Electronics (H.K.) Ltd. Winbond Electronics North America Corp.
No. 4, Creation Rd. III, Unit 9-15, 22F, Millennium City, Winbond Memory Lab.
Science-Based Industrial Park, No. 378 Kwun Tong Rd; Winbond Microelectronics Corp.
Hsinchu, Taiwan Kowloon, Hong Kong
TEL: 886-3-5770066 TEL: 852-27513100
Winbond Systems Lab.
FAX: 886-3-5792766 FAX: 852-27552064 2727 N. First Street, San Jose,
http://www.winbond.com.tw/ CA 95134, U.S.A.
Voice & Fax-on-demand: 886-2-27197006 TEL: 408-9436666
FAX: 408-5441798
Taipei Office
11F, No. 115, Sec. 3, Min-Sheng East Rd.,
Taipei, Taiwan
TEL: 886-2-27190505
FAX: 886-2-27197502
Note: All data and specifications are subject to change withou t notice.
- 38 -