Specifications

V850E2/MN4 USB CDC (Communication Device Class) Driver
R01AN0010EJ0101 Rev.1.01 Page 26 of 117
Feb 01, 2012
(9)
Setting up the Interrupt Mask Register
Sets the mask bits associated with the interrupt sources of the USB function controller.
The following registers are accessed during this processing:
(a) The USFA0ICn registers (n = 0 to 4) are loaded with “0x00. This setting causes all interrupt sources to be cleared.
(b) The USFA0FIC0 register is loaded with “0xF7” and the USFA0FIC1 register with “0x0F.” These settings cause all
FIFOs available for data transfer to be cleared.
(c) The USFA0IM0 register is loaded with “0x1B.” This setting masks all interrupt sources defined in the USFA0IS0
register, except those for the BUSRST, RSUSPD, and SETRQ interrupts.
(d) The USFA0IM1 register is loaded with “0x7E.” This setting masks all interrupt sources defined in the USFA0IS1
register, except that for the CPUDEC interrupt.
(e) The USFA0IM2 register is loaded with “0xF1.” This setting masks all interrupt sources defined in the USFA0IS2
register.
(f) The USFA0IM3 register is loaded with “0xFE.” This setting masks all interrupt sources defined in the USFA0IS3
register, except that for the BKO1DT interrupt.
(g) The USFA0IM4 register is loaded with “0x20.” This setting masks all interrupt sources defined in the USFA0IS4
register.
(i) The USFA0EPCINTE register is loaded with “0x0003” to enable the interrupts for which the EPC_INT0BEN and
EPC_INT1BEN bits are set.
(j) The ICUSFA0I1 is loaded with “0” and the ICUSFA0I2 with “0” to enable INTUSFA0I1 and INTUSFA0I2,
respectively.
(10)
Initializing the Internal Driver Flags
Initializes the flags (usbf850_busrst_flg, usbf850_rsuspd_flg, and usbf850_rdata_flg) that are to be used within the
driver.
(11)
Setting up the D+ signal as pull-up
Loads the CPU’s P4 register with “0x0400.” This setting causes a “1” to be output from P4_10, which generates a high-
level output from the D+ signal pin, notifying the host that a device has been connected. The sample driver assumes the
wiring configuration shown in figure 4.4.
INTUSFA0I1
P4_10
UV
DD
UV
DD
1.5 kΩ ± 5%
R1
UDPF
UDMF
27 kΩ ± 5%
27 kΩ ± 5%
VBUS
D+
D-
R2
More than
50 kΩ
USB connector
USB function controller
incorporated in microcontroller
Figure 4.4 USB Function Controller Configuration Example