Home

EMC EM78612 User's Manual

image

Contents

1. ms or os os o3 v2 ov 00 CALL mr 0 Joo os or o6 o5 04 v5 02 01 00 aN Eli j y Cae 1 9 wr Sw Fig 7 2 The Structure of ROM Page R3 Status Register Default Value 0B 0001 1000 R3 0 Carry y Borrow flag For ADD SUB Instructions 1 Acarry out from the Most Significant bit of the result occurred 0 No carry out from the Most Significant bit of the result occurred R3 1 Auxiliary carry borrow flag For ADD SUB Instructions 1 A carry out from the 4th low order bit of the result occurred 0 No carry out from the 4th low order bit of the result Product Specification V1 0 03 22 2006 e 11 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 12 o R3 2 Zero flag It will be set to 1 when the result of an arithmetic or logic operation is Zero R3 3 Power down flag It will be set to 1 during Power on phase or by WDTO command and cleared when the MCU enters into Power down mode It remains in previous state after WatchDog Reset 1 Power on 0 Power down R3 4 Time out flag It will be set to 1 during Power on phase or by WDTC command It is reset to 0 by WDT time out 1 WatchDog timer without overflow 0 WatchDog timer with overflow The various states of Power down flag and Time out flag at different conditions are shown below Power on reset WDTC instruction WDT
2. Ll A es 0x00 RO Indirect Addressing Register OB 0000 0000 0x01 RI TCC J Timer Clock Counter OB 0000 0000 0x02 R2 PC Program Counter OB 0000 0000 0x04 RA RSR BKO Select the register address 00 3F in the indirect addressing mode OB xxx xxxx P7 OB 0000 0000 R8 Port6 0x08 Wake up Pin Wu67 Wu66 Wu65 Wu64 Wu63 Wu60 OB 11H 111 Selection R9 Port7 ER D p po mmm m e om Selection Device Host UDC OXOD RD USB Application FIFO Address Register 0B 0000 0000 0x06 R6 Port6 0x07 R7 Port7 P51 D P50 D 0x05 R5 Port5 OB 0000 0000 DATA CLK OxOE USB Application FIFO Data Register OB 0000 0000 USB Host RF EPI IF Port5 state Heus USB USB EPO IF TCC IF 0B 0000 0000 change IF IF Reset IF Suspend IF 7 7 Control Registers a a a a a a a 0x05 IOC5 Port5 Direction Control Register OB 0000 0011 0x06 IOC6 Port6 Direction Control Register OB 1111 1111 0x07 IOC7 Port7 Direction Control Register OB 0000 1111 pem D eee T Tee mm Current 0x09 1009 Reserved 0x0B IPL67 PL66 PL65 PL64 PL63 PL62 PL61 PL60 OB 0000 0000 Ox0C PH67 PH66 PH65 PH64 PH63 PH62 PH61 PH60 0B 0000 0000 0x0F IOCF Epig oO eUB HOST SB USB EPO IE TCC IE 0B 0000 0000 Change IE Resume IF Reset IE Suspend IE E m Product Specification V1 0 03 22 2006 e 31 This specification is subject to change without further notice EM78612 Univ
3. Individual interrupt is enabled by setting its associated control bit in the IOCF to 1 1 Enable Interrupt 0 Disable Interrupt IOCF 6 Default value is zero and do not modify it Only when the global interrupt is enabled by the ENI instruction that the individual interrupt will work After DISI instruction any interrupt will not work even if the respective control bits of IOCF are set to 1 The USB Host Resume Interrupt works only under Dual clock mode This is because when the MCU is under sleep mode it will be waked up by the UDC Resume signal automatically 7 2 2 USB Application FIFOs For USB Application EM78612 provides an 8 byte First In First Out FIFO buffer for each endpoint The buffer cannot be accessed directly However a corresponding Data Byte Pointer register for each endpoint is made available to address the individual byte of the FIFO buffer The content of the individual byte will map to a special register Product Specification V1 0 03 22 2006 e 21 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller Address RD 0X10 Data Byte Pointer of EPO OXII Data Byte Pointer of EPI Counter Pointer Counter Pointer 0X00 EPO s FIFO OXOI EPI s HFO 0 0 i l 2 2 3 3 4 4 5 5 6 6 7 7 Bi direction
4. Universal Serial Bus Microcontroller PS 2 Mode USB Test Mode IOCA 2 5 Undefined registers The default value is 0 IOCA 6 7 Select the operation frequency in Dual Clock Mode Four frequencies are available and can be chosen as Dual Clock mode for running the MCU program Dual_Frq 1 DITE TE a ce me Frequency 1 0 IOCB 0 7 Select whether the 10K Ohm pull low resistor of Port 6 individual pin is connected or not 1 Enable the pull low function 0 Disable the pull low function IOCC Port 6 Pull High Control Register Default Value OB 0000 0000 a RE ERR IOCC 0 7 Select whether the 132K Ohm pull high resistor of Port 6 individual pin is connected or not 1 Enable the pull high function 0 Disable the pull high function Product Specification V1 0 03 22 2006 e 19 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller IOCD Port 7 Pull High Control Register Default Value OB 0000 0000 3 2 1 0 IOCD 0 3 Select whether the 132K Ohm pull high resistor of Port 7 individual pin is connected or not 1 Enable the pull high function 0 Disable the pull high function IOCE Special Function Control Register Default Value OB 1111 0000 07 6 5 IOCE 0 3 Undefined register The default value is zero IOCE 4 Run bit This bit can be cleared by the firmware and set during power on or by the hardware at the
5. Default Value OB 0000 0000 7 6 5 R8 0 7 Select which of the Port 6 pins are to be defined to wake up the MCU from sleep mode When the state of the selected pins changes during sleep mode the MCU will wake up and execute the next instruction automatically 1 Disable the wake up function Product Specification V1 0 03 22 2006 e 13 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 14 o re 0 Enable the wake up function R9 Port 7 Wake up Pin Selection Register Default Value OB_1111_1111 3 2 1 0 H9 0 3 Select which of the Port 7 pins are to be defined to wake up the MCU from sleep mode When the state of the selected pins changes during sleep mode the MCU will wake up and execute the next instruction automatically 1 Disable the wake up function 0 Enable the wake up function RC USB Application Status Register Default Value OB 0000 0000 07 6 5 a 3 2 1 o0 EPO W EPOR EP1 R 0 Device Resume Host Suspend EPO Busy Stall RC 0 Stall flag When MCU receives an unsupported command or invalid parameters from host this bit will be set to 1 by the firmware to notify the UDC to return a STALL handshake When a successful SETUP transaction is received this bit is cleared automatically This bit is both readable and writable RC 1 EPO Busy flag When this bit is equal to 1 it indicates that the UDC
6. falling edge of wake up signal When this bit is cleared the clock system is disabled and the MCU enters into power down mode At the transition of wake up signal from high to low this bit is set to enable the clock system 1 Run mode The EM78612 is working normally 0 Sleep mode The EM78612 is in power down mode IOCE 5 WatchDog Timer enable bit The bit disable enables the WatchDog Timer 1 Enable WDT 0 Disable WDT IOCE 6 Enable the wake up function as triggered by port change This bit is set by UDC 1 Disable the wake up function 0 Enable the wake up function IOCE 7 Dual clock Control bit This bit is used to select the frequency of system clock When this bit is cleared the MCU will run on very low frequency save power and the UDC will stop working 1 Selects EM78612 to run on normal frequency 0 Selects to run on slow frequency 20 o Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller IOCF Interrupt Mask Register Default Value OB 0000 0000 7 6 5 4 3 2 1 o0 Port 5 State USB Host USB USB IOCF 0 5 TCC EPO USB Suspend USB Reset USB Host Resume Port 5 otate Change enable bits These eight bits respectively control the function of TCC interrupt EPO interrupt USB Suspend interrupt USB Reset interrupt USB Host Resume interrupt Ports State Change interrupt
7. gen Contents 1 General Description PTC eee eT TT eT eee Te TT eT er eT eee ee ee oe ere re 4 2 Featu OS RELLLEEEEEELIEELITELITCITT LITE TTL TITEL EET TTE L ITE TETT TIT ETE ETT EETE TTL T IT TT TTCETTC TIT T ETT LITLLTTLIT 4 3 Applications P 5 4 Pin Configuration 6 5 Pin Description 7 6 Function Block Diagram eres 8 7 Function Description 8 7 1 Program Memory 6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 8 7 2 Data Memory 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 9 7 2 1 Special Purpose Registers E E E ASES I E E EAEE E E A A 9 7 2 2 USB Application FOS T 21 7 3 VO Ports 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 22 7 3 1 Programmable Large GUTMESIMQILLLLLITLLILLIDDI 22 7 3 2 Wakeup by Port Change C O Ro ee ee ee 22 7 4 USB Application 00000000000000000000000000000000000000000000000000000
8. is writing data into the EPO FIFO or reading data from it During this time the firmware will avoid accessing the FIFO until UDC finishes writing or reading This bit is only readable RC 2 Host Suspend flag If this bit is equal to 1 it indicates that USB bus has no traffic for the specified period of 3 0 ms This bit will also be cleared automatically when a bus activity takes place This bit is only readable This bit should be used in Dual Mode RC 3 Device Resume flag This bit is set by firmware to general a signal to wake up the USB host and is cleared as soon as the USB Suspend signal becomes low This bit can only be set by firmware and cleared by the hardware x This bit should be used in Dual Mode RC 4 Undefined Register The default value is O RC 5 6 EP1 R EPO RH flag These two bits inform the UDC to read the data written by firmware from the FIFO Then the UDC sends the data to the host automatically After UDC finishes reading the data from the FIFO this bit is cleared automatically Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller Therefore before writing data into the FIFO the firmware will first check this bit to prevent overwriting the existing data These two bits can only be set by the firmware and cleared by the hardware RC 7 EPO W flag After the UDC completes writing data to the FIFO
9. option registers which are not part of the normal program memory The option bits cannot be accessed during normal program execution LLL e Bit 0 Frequency Frequency Selection 0 The MCU run on 12 MHz 1 The MCU run on 6 MHz Bit 2 1 OST 1 OST 0 Oscillator Start up Time 00 500us 01 2ms 10 8ms 11 16ms Bit 4 3 Package 1 Package O0 Package type selector 00 16 pins 01 18 pins 10 20 pins 11 No define Bit 5 R S Resistor Switch enable of Transceiver 0 Disconnect internal USB D pull high Register 1 Connect internal USB D pull high Resister Bit 8 6 The values are fixed Product Specification V1 0 03 22 2006 e 35 This specification is subject to change without further notice
10. time out Power down mode Wakeup caused by port change during Power down mode P Previous status before WDT reset R3 5 Page selection bit This bit is used to select a page of program memory refer to H2 Eum Counter Page 0 0000 03FF 4 Page 1 0400 07FF H3 6 7 Reserved registers Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller R4 RAM Select Register Default Value OB Oxxx xxxx R4 RAM select register contains the address of the registers R4 0 5 are used to select registers in OxX00h Ox3Fh The address 0x00 0x1F is common space After Ox1Fh SRAM is grouped into two banks R4 6 are used to select register banks To select a registers bank refer to the following examples and the table below R4 01111100 points to the register Ox3C in Bank 1 RA G BkO RAM Bank 0 Bank 0 1 Bank 1 R5 Data Line I O Register Default Value OB 0000 0000 d o orata br or cux R5 0 USB D line register or PS 2 clock interface register R5 1 USB D line register or PS 2 data interface register These two bits are BOTH writable and readable when the MCU is operating under PS 2 mode But under USB Mode these two bits cannot be accessed H5 2 7 NON Used The value is zero R6 Port 6 I O Register Default Value OB 0000 0000 A ERN R7 Port 7 I O Register
11. 000000000000000000000000000000000000000000000000000000000000000000000000 23 7 4 1 Detect PS 2 or USB Mode eeeeeeee eere eere eee eere erre eee eere eere erre rrr rn 23 7 4 2 USB Device Controller eeeeeeueeeeee eee eee eere eee eee eere eee erre eren rennen 24 7 4 3 Device Address and Endpoints P EE E E 24 7 5 Reset 24 7 5 1 Power On WESEL einer an a E ENO E EREE M 24 7 5 2 WatchDog eels E E ee ee 25 7 5 3 USB Rosei eee en niea E A E 25 7 6 Power Saving Mode sseeeeeseececceccescesoosocooccocoocoosocsocsocsocoocoocoosoosocsossocoossosoosoosocsocsocoocsososoossosoosoosossossos 25 7 6 1 Power Down Mode eere ener EEE EEEE EREE 25 7 6 2 Dual Clock Mode eere ree eere ee eere E eere eee eren eere eren eene enhn hne 26 7 7 Interrupt 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 26 Product Specification V1 0 03 22 2006 e 1 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 8 Absolute Maximum Ratings TEE EL eee ee eee Lee er LU 27 9 DC Electrical CharacteristiQi iieri rr nentur Renta o don Erainn 28 10 Application e UOI 30 APPENDIX A Special Register Map secnsee titres eremi tutioterenibeqe etree 31 ZNMuiPeueske c T T mm 32 C Code option Register 34 2 Product Specification V1 0 03 22 2
12. 006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller Specification Revision History Doc Version Revision Description Dae Initial Version 2006 03 22 Product Specification V1 0 03 22 2006 e 3 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 1 General Description The EM78612 is a series of Universal Serial Bus 8 bit RISC microcontrollers It is specifically designed for USB low speed device application and to support legacy device such as PS 2 mouse The EM78612 also support one device address and two endpoints The EM78612 is implemented on a HISC architecture It has five level stack and six interrupt sources The amount of General Input Output pins is up to12 Each device has 80 bytes SRAM The ROM size of the EM78612 is 2K These series of chips have Dual Clock mode which allows the device to run on low power saving frequency 2 Features B Low cost solution for low speed USB devices such as mouse joystick and gamepad B USB Specification Compliance Universal Serial Bus Specification Version 1 1 e USB Device Class Definition for Human Interface Device HID Firmware Specification Version 1 1 e Support 1 device address and 2 endpoints EPO and EP1 B USB Application e USB protocol handling e USB device state handling e Identifies and decodes Standard USB commands to En
13. 12 Universal Serial Bus Microcontroller 6 Function Block Diagram OSCI OSCO VDD V3 3 D D Stack Lt Jf dd ag i k4 Built in Oscillator d gt Transceiver Stac RC gt Timing Regulator Stack5 Control USB R3 Device Instruction Status Controller register Prescaler Prescaler WDT TCC Reset amp Sleep amp Interrupt Wake up Control Instruction Control Decoder DATA amp CONTROL BUS 1 l d Figure 6 1 EM78612 Series Function Block Diagram 7 Function Description The memory of EM78612 is organized into four spaces namely User Program Memory in 2048 13 bits MASK ROM space Data Memory in 80 bytes SRAM space and USB Application FIFOs for EndPointO and EndPoint1 Furthermore several registers are used for special purposes 7 1 Program Memory The program space of the EM78612 is 2K words and is divided into two pages Each page has 1K words long After Reset the 12 bit Program Counter PC points to location zero of the program space It has two interrupt vectors i e Interrupt Vectors at 0x0001 and USB Application Interrupt Vectors at 0x000A The Interrupt Vector applies to TCC Interrupt and Port 5 St
14. 22 2006 e 27 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 9 DC Electrical Characteristic T 25C VDD 5V VSS OV 3 3V Regulator Wee Low Power Reset detctnglowvotagef C Vas Low Power Reset detecting righ vore Ces 38V Regulator arving cepas vasco 100 ma MCU Operation ric trout Leakage Curentforinputpins VNeWevSS Jafa Cw GekmeHgnVotge Josa 25 V Va Glockinputtowvotage Osi 9 V Vpp operating supply current Normal frequency operation mode iiis MM EU O ti t1 Isp dida be Ld AE WDT disabled 100 A Power down mode Vw InputHigh Voltage Ports 20 V Vvu InputLowvoltage Ports os v Vm InputHigh Voltage Pot 8 7 1 20 los v Output High Voltage Von 2 4V lon 11 mA Vol Vor 0 4V Port 6 VREG 3 3 V High Vol Vom 2 4V Port5 Vpp 5V Low Vol Vor 2 4V Port5 Vpp 5V The input pin with internal Rey Pull high resister pull high resistor of Port6 or KO Port7 is connected to Vss The input pin with internal RpL Pull low resister pull low resistor of Port6 is KO connected to Vpp USB Interface ferent e USB operation Mode Differential Input Command Mode Range Single Ended Receiver Threshold USB operation Mode Product Specification V1 0 03 22 2006 This specifi
15. EM 8612 Universal Serial Bus Microcontroller Product Specification ELAN MICROELECTRONICS CORP March 2006 e Trademark Acknowledgments IBM is a registered trademark and PS 2 is a trademark of IBM Windows is a trademark of Microsoft Corporation ELAN and ELAN logo ram are trademarks of ELAN Microelectronics Corporation Copyright 2006 by ELAN Microelectronics Corporation All Rights Reserved Printed in Taiwan The contents of in this specification are subject to change without notice ELAN Microelectronics assumes no responsibility concerning the accuracy adequacy or completeness of this specification ELAN Microelectronics makes no commitment to update or to keep current the information and material contained in this specification Such information and material may change to conform to each confirmed order In no event shall ELAN Microelectronics be made responsible to any claims attributed to errors omissions or other inaccuracies in the information or material contained in this specification ELAN Microelectronics shall not be liable for direct indirect special incidental or consequential damages arising out of the use of such information or material The software 1f any described in this specification is furnished under a license or nondisclosure agreement and may be used or copied only in accordance with the terms of such agreement ELAN Microelectronics products are not intended for use in life supp
16. The pull high resistors 132K Ohms and pull low resistors 10K Ohm are selected through pin programming Port7 offers up to 4 GIOP pins The sink current of P70 amp P71 are programmable P70 P73 for driving LED Each pin has pull high resistors 132K Ohm that can be selected through pin programming When this pin is used as a PS 2 line interface it will generate an interrupt when its state changes Port5 state change interrupt enable USB Minus data line interface or PS 2 line interface are user defined through firmware setting When the EM78612 is running under PS 2 mode this pin will have an internal pulled high resistor 2 2K Ohm with Vpp 5 0V When this pin is used as a PS 2 line interface it will generate an interrupt when its state changes Port5 state change interrupt enable D P51 When the EM78612 is running under USB mode this pin will have an internal pulled high resistor 1 5k Ohm with V3 3 3 3V Connects to the USB power source or to a nominal 5V power supply Actual Vpp range can vary between 4 4V and 5 2V Connects to ground Table 5 1 Pin Descriptions USB Plus data line interface or PS 2 line interface are user defined through firmware setting D P50 When the EM78612 is running under PS 2 mode this pin will have an internal pulled high resistor 2 2K Ohm with Vpp 5 0V Product Specification V1 0 03 22 2006 e 7 This specification is subject to change without further notice EM786
17. al Uni directional 7 3 O Ports The EM78612 has up to twelve General Purposes l O pins which are classifies into two port groups Port 6 and Port 7 Each pin has an internal resistor that can be individually selected by user The following describes the important features o EM78612 I O pins 7 3 1 Programmable Large Current Port 7 has two pins P70 and P71 that can drive large current of up to 30mA The range of driving current is from 3mA to 30mA which is programmable Use IOC8 0 1 and IOC8 4 5 to control the sink current of P70 P71 The default current is 3mA 7 3 2 Wakeup by Port Change Function Each of the GPIO pins in Port 6 and Port 7 can wakeup the MCU through signal change from input pin This function is used to wake up the MCU automatically from sleep mode It also supports the remote wake up function for USB application 22 o Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller Any of the Individual pins of Port 6 and Port 7 can be defined to wakeup the MCU by setting their respective bits R8 and R9 7 4 USB Application EM78612 is specially designed for USB device application and has many powerful functions that help the firmware to free itself from complex situation in various aspects of USB application 7 4 1 Detect PS 2 or USB Mode When the EM78612 is connected to the bus the firmware should detect
18. and identify which type of bus USB or PS 2 it is connected to The conditions that influence detect function are described below 1 After a Power on reset the initial value of IOCA 0 1 is 0b00 Thus the operation mode is Detect mode and the D and D I O pins are internal pulled high by 200K Ohm to VDD 2 The firmware checks the state of R5 0 1 If the state with which these two bits is ObOO set the IOCA 0 to 1 to define the USB mode Otherwise set the IOCA 1 to 1 to define PS 2 mode 3 When the operation mode is defined as USB mode the D I O pin is internal pulled high by a 1 5K Ohm resistor to 3 3V which is output from a built in regulator 4 fthe operation mode is in PS 2 mode both of the PS 2 interface I O pins are internal pulled high by a 2 2K Ohm resistor to Vpp An additional mode USB Test Mode is also available This mode has no load on D and D I O pins and can only be used in USB Application case Therefore an external 1 5K Ohm resistor is needed to pull up D IO pin to 3 3V Under PS 2 mode both PS 2 pins are programmed to generate an interrupt After setting the Port 5 State change to Interrupt Enable bit the MCU will interrupt while the state of these two pins changes Product Specification V1 0 03 22 2006 e 23 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller re 7 4 2 USB Device Control
19. are also available Except for the Accumulator A these registers must be read and written by special instructions One of these registers CONT can only be read by the instruction CONTR and written by CONTW instruction The remaining special control registers can be read by the instruction IOR and written by the instruction IOW A Accumulator Register The accumulator is an 8 bit register that holds operands and results of arithmetic calculations It is not addressable 16 o Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller CONT Control Register 7 6 5 4 3 2 L 0 CONT 0 2 WatchDog Timer prescaler bits These three bits are used as the prescaler of WatchDog Timer CONT 8 5 TCC Timer prescaler bits The relationship between the prescaler value and these bits are as shown below PSR2 TSR2 PSR1 TSR1 PSRO TSRO TCC Rate WDT Rate 8mS EET m xm omero sams eww 128 me ECCTINNNE T MN omena ume C omne 256 1024 me CONT 6 Interrupt enable control bit This bit toggles Interrupt function between enable and disable It is set to 1 by the interrupt disable instruction DISI and reset by the interrupt enable instructions ENI or RETI 0 Enable the Interrupt function 1 Disable the Interrupt function CONT 7 Remote wake up enable bit This bit is set to 1 if host enables device to remote wak
20. ate Changed Interrupt The USB Application Interrupt Vector is for USB EndPoint Zero Interrupt USB Suspend Interrupt USB Reset interrupt and USB Host Resume Interrupt After an interrupt the MCU will fetch the next instruction from the corresponding address as illustrated in the following diagram 8 o Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller e After reset Address Program Counter 0x0000 Reset Vector 0x0001 Interrupt Vector 0x000A USB Application Interrupt Vector omo OxOSFF 0x0400 0x07FF 7 2 Data Memory The Data Memory has 80 bytes SRAM space It is also equipped with USB Application FIFO space for USB Application The Figure 7 1 next page shows the organization of the Data Memory Space 7 2 1 Special Purpose Registers When the micro controller executes the instruction specific registers are invoked for assistance such as Status Register which records the calculation status Port I O Control Registers which control the I O pins direction etc The EM78612 series provides a lot more of other special purpose registers with different functions There are 15 Special Operation Registers which are located from Address 0x00 to OxOF On other hand 10 more Special Control Registers are available to control functions or I O direction These are arranged from Address 0x05 to OxOF Product Sp
21. cation is subject to change without further notice 28 EM78612 Universal Serial Bus Microcontroller Output Voltage of Internal Regulator Pull high resister PH D Programmable Large Current TM Mu aaa pr v ome ue mace fa DIM Product Specification V1 0 03 22 2006 e 29 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 10 Application Cricuit EM78612 CP USB Application V3 3 VDD P65 P66 P67 P71 USB connector P73 Notel IF IOCA USB mode MCU D pin internal pull high to V3 3 with 1 5k resistor D CLK P50 Note2 IF IOCA USB test mode it is necessary that V3 3 D pin external pull high to V3 3 with 1 5k P51 j A D DATA ieee VDD resistor i VDD C1 C2 G3 10uF 0 1uF 4 7uF gt PS 2 Application Y 1 C4 C5 6MHz or 12MHz resonator Spr 30pF Note PS 2 connector A Place Cl and C2 close to MCU VDD pin B Place Y1 C4 and C5 close to MCU OSCI pin l l C In USB application it is necessary to place C3 close to MCU V3 3 pin te3 IF IOCA PS 2 mode MCU CIK and DATA pin E Port60 is input only and without internal pull high and pull low resistor 30 e Product Specification V1 0 03 22 2006 This specification is subject to change without further notice Or EM78612 Kc Universal Serial Bus Microcontroller Appendix A Special Register Map Operation Registers
22. d the correct data from EM78612 7 5 Reset The EM78612 provides three types of reset 1 Power on Reset 2 WatchDog Reset and 3 USB Reset 7 5 1 Power On Reset Power on Reset occurs when the device is attached to power and a reset signal is initiated The signal will last until the MCU becomes stable After a Power on Reset the MCU enters into following predetermined states See below and then it is ready to execute the program A The program counter is cleared B The TCC timer and WatchDog timer are cleared 24 e Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller C Special registers and Special Control registers are all set to initial value The MCU also has a low voltage detector that detects low output power condition Whenever the output voltage of the 3 3V regulator decreases to below 2 2V a reset signal is set off 7 5 2 WatchDog Reset When the WatchDog timer overflows it causes the WatchDog to reset After it resets the program is executed from the beginning and some registers will be reset The UDC however remains unaffected 7 5 3 USB Reset When UDC detects a USB Reset signal on USB Bus it interrupts the MCU then proceed to perform the specified process that follows After a USB device is attached to the USB port it cannot respond to any bus transactions until it receives a USB Reset signa
23. dPoint Zero B PS 2 Application Support e Built in PS 2 port interface B Built in 8 bit RISC MCU e 5 level stacks for subroutine and interrupt e 6 available interrupts e 8 bit real time clock counter TCC with overflow interrupt e Built in RC oscillator free running for WatchDog Timer and Dual clock mode e Two independent programmable prescalers for WDT and TCC e Two methods of power saving 1 Power down mode SLEEP mode 2 Low frequency mode e Two clocks per instruction cycle B O Ports 4 e Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller e Up to 12 general purposes I O pins grouped into two ports Port 6 and 7 e Up to 2 LED sink pins e Each GPIO pin of Ports 6 amp Port 7 has an internal programmable pull high resistor e Each GPIO pin of Ports 6 has an internal programmable pull low resistor e Each GPIO pin wakes up the MCU from sleep mode by input state change B Internal Memory e Built in 2048 13 bits MASK ROM e Built in 80 bytes general purpose registers SRAM e Built in USB Application FIFOs B Operation Frequency e Normal Mode MCU runs on the external oscillator frequency e Dual Clock Mode MCU runs at the frequency of 256 KHz or 32KHz 4KHz 500HZ emitted by the internal oscillator with the external ceramic resonator turned off to save power B Built in 3 3V Voltage Regulator e For MCU power
24. e up PC It could be modified by SetFeature amp ClearFeature Hequest lOC5 IOC7 I O Port Direction Control Registers Each bit controls the I O direction of three I O ports Port5b Port respectively When these bits are set to 1 the relative I O pins become input pins Similarly the I O pins becomes outputs when the relative control bits are cleared 1 Input direction 0 Output direction Product Specification V1 0 03 22 2006 e 17 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller re lOC5 Data Line I O Control Register Default Value OB 0000 0011 QUT o 5 A a 2 To aO po oj o yj o o o j rj mo IOC5 2 7 Undefined registers The default value is O lOC6 Port 6 I O Control Register Default Value OB 1111 1111 5 4 1 0 smaa sna o o smor smono IOC8 0 1 4 5 are P70 P71 sink current control registers Four levels are offered for selection Sink0 1 1 1 Sink0 0 1 0 Sink Current The default current after Power on reset is 3mA IOCA Operation Mode Control Register Default Value OB 1100 0011 7 6 IOCA 0 1 These two bits are used to select the operation mode The definition of these two control registers is described in the table below IOCA 1 IOCA 0 Operation Mode 18 o Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612
25. ecification V1 0 03 22 2006 e 9 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 10 o 00 Ro indirection Addressing Registe 07 Ri Time Clock Counter Registe 02 R2 Program Counter amp Stack 03 R3 Status Register 4 os o6 R4 RAM Select Register RU 08 Rs Port wakeup pin selection Register 09 R9 Port wakeup pin selection Register S cU LLLI OCB Port 6 pull low Control Register l RC USB Application Status Register IOCC Port 6 pull high Control Register RD USB Application FIFO address register 4 IOCD Port 7 pull high Control Register l l 10C5 Port 5 I O Control Register 1OC6 Port 6 I O Control Register 10C7 Port 7 I O Control Register 10C8 Sink Curent Control Register IOCA Operation mode Control Register OCE Special Function Control Register OCF Interrupt Mask Register RE USB Application FIFO data register RF Interrupt Status Register Data Byte Pointer of EPO Data Byte Pointer of EP1 General Purpose General Purpose Registers Registers BankO Bank1 Fig 7 1 The Organization of EM78612 Data HAM 7 2 1 1 Operation Registers in Bank 0 The following introduces each of the Operation Registers under the Special Purpose Registers The Operation Registers are arranged according to the order of registers address Note that some regi
26. ersal Serial Bus Microcontroller B Instruction Set Each instruction in the instruction set is a 11 bit word divided into an OP code and one or more operands All instructions are executed within one single instruction cycle consisting of 2 oscillator periods unless the program counter is changed by a Executing the instruction MOV R2 A ADD R2 A TBL or any other instructions that write to R2 e g SUB R2 A BS R2 6 CLR R2 b execute CALL RET RETI RETL JMP Conditional skip JBS JBC JZ JZA DJZ DJZA which were tested to be true Under these cases the execution takes two instruction cycles In addition the instruction set has the following features 1 Every bit of any register can be set cleared or tested directly 2 The I O register can be regarded as general register That is the same instruction can operate on I O register The symbol R represents a register designator that specifies which one of the registers including operational registers and general purpose registers is to be utilized by the instruction Bits 6 and 7 in R4 determine the selected register bank b represents a bit field designator that selects the value for the bit located in the register R and affects operation k represents an 8 or 10 bit constant or literal value 0 0000 0001 0011 0013 RETI Top of Stack gt PG None Enable Interrupt 0 0000 0001 0100 0014 CONTR CONT gt A O 0000 0001
27. fth byte data byte4 of the EPO FIFO Product Specification V1 0 03 22 2006 e 15 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller RF Interrupt Status Register Default Value OB 0000 0000 Port 5 State USB Host USB USB Change IF Resume IF Reset IF Suspend IF EPO IF TCC IF HF 0 TCC Overflow interrupt flag It will be set while TCC overflows and is cleared by the firmware HF 1 EndPoint Zero interrupt flag It will be set when the EM78612 receives Vender Customer Command to EndPoint Zero This bit is cleared by the firmware RF 2 USB Suspend interrupt flag It will be set when the EM78612 finds the USB Suspend Signal on USB bus This bit is cleared by the firmware HF 3 USB Reset interrupt flag It will be set when the host issues the USB Reset signal HF 4 USB Host Resume interrupt flag It is set only under Dual Clock mode when the USB suspend signal becomes low RF 5 Port 5 State Change interrupt flag It is set when the Port 5 state changes Port 5 state change interrupt only work in PS 2 mode RF 6 Default value is zero and do not modify it R10 R1F are General purpose registers These registers can be used no matter what Bank Selector is There are 2 banks BKO amp BK1 R20 R3F General purpose registers Select by R4 6 7 2 1 2 Control Registers in Bank 0 opecial purpose registers for special control purposes
28. l from the bus 7 6 Power Saving Mode The EM78612 provides two options of power saving modes for energy conservation i e Power Down mode and Dual Clock mode 7 6 1 Power Down Mode The EM78612 enters into Power Down mode by clearing the RUN register IOCE 4 During this mode the oscillator is turned off and the MCU goes to sleep It will wake up when signal from USB host is resumed or when the WatchDog resets or the input port state changes If the MCU wakes up when I O port status changes the direction of I O port direction should be set at input direction then read the state of port For example Set the Port 6 to input port MOV A QOXFF IOW PORT6 Read the state of Port 60 MOV PORT6 PORT6 Clear the RUN bit IOR OXOE AND A 0B11101111 IOW OXOE Product Specification V1 0 03 22 2006 e 25 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 7 6 2 Dual Clock Mode The EM78612 has one internal oscillator for power saving application Clearing the Bit IOCE 7 will enable the low frequency oscillator At the same time the external oscillator will be turned off Then the MCU will run under very low frequency to conserve power Four types of frequency are available for selection in setting Bits IOCA 6 7 The USB Host Resume Interrupt can only be used in this mode If this interrupt is enabled the MCU will be interrupted when the USB Host Re
29. ler The USB Device Controller UDC built in in the EM78612 can interpret the USB Standard Command and response automatically without involving firmware The embedded Series Interface Engine SIE handles the serialization and deserialization of actual USB transmission Thus a developer can concentrate his efforts more in perfecting the device actual functions and spend less energy in dealing with USB transaction The UDC handles and decodes most Standard USB commands defined in the USB Specification Rev1 1 If UDC receives an unsupported command it will set a flag to notify MCU the receipt of such command The Standard Commands that EM78612 supports includes Clear Feature Get Configuration Get Interface Get Status Set Address Set Configuration Set Feature and Set Interface Each time UDC receives a USB command it writes the command into EPO s FIFO Only when it receives unsupported command that the UDC will notify the MCU through interrupt Therefore EM78612 is very flexible under USB application because the developer can freely choose the method of decoding the USB command as dictated by different situation 7 4 3 Device Address and Endpoints EM78612 supports one device address two endpoints EPO for control endpoint and EP1 for interrupt endpoint Sending data to USB host in EM78612 is very easy Just write data into EP s FIFO then set flag and the UDC will handle the rest It will then confirm that the USB host has receive
30. o 0 the hardware interrupt will inhibit that is the EM78612 will not jump to the interrupt vector to execute instructions But the interrupt status flags still records the conditions no matter whether the interrupt is masked or not The interrupt 26 o Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller status flags must be cleared by firmware before leaving the interrupt service routine and enabling interrupt The global interrupt is enabled by the ENI RETI instruction and is disabled by the DISI instruction E interrupt flag If a bit of RF is asserted it means the relative interrupt requested B he priority of USB TCC interrupt is USB gt TCC B he additional hardware process step of the interrupt occurred including A gt Disable interrupt means reserving next time interrupt process until the instruction RETI executed B gt Jump to interrupt vector C Push Accumulator H3 and H4 Steps A B and C are executed at the same time D gt Clear R3 and R4 E If the instruction RETI is executed pop Accumulator R3 and R4 F gt Return to main program and enable interrupt Step E and F are executed at the same time 8 Absolute Maximum Ratings Symbol Temperature under bias Storage temperature Input voltage Output voltage Product Specification V1 0 03
31. ort appliances devices or systems Use of ELAN Microelectronics product in such applications is not supported and is prohibited NO PART OF THIS SPECIFICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY ANY MEANS WITHOUT THE EXPRESS WRITTEN PERMISSION OF ELAN MICROELECTRONICS Yw Headquarters No 12 Innovation Road 1 Science based Industrial Park Hsinchu Taiwan 308 Tel 886 3 563 9977 Fax 886 3 563 9966 http www emc com tw Europe Elan Microelectronics Corp Europe Siewerdtstrasse 105 8050 Zurich SWITZERLAND Tel 41 43 299 4060 Fax 41 43 299 4079 http www elan europe com Hong Kong Elan HK Microelectronics Corporation Ltd Rm 1005B 10 F Empire Centre 68 Mody Road Tsimshatsui Kowloon HONG KONG Tel 852 2723 3376 Fax 852 2723 7780 elanhk emc com hk Shenzhen Elan Microelectronics Shenzhen Ltd SSMEC Bldg 3F Gaoxin S Ave Shenzhen Hi Tech Industrial Park Shenzhen Guandong CHINA Tel 86 755 2601 0565 Fax 86 755 2601 0500 Es ELAN MICROELECTRONICS CORPORATION USA Elan Information Technology Group 1821 Saratoga Ave Suite 250 Saratoga CA 95070 USA Tel 1 408 366 8223 Fax 1 408 366 8220 Shanghai Elan Microelectronics Shanghai Corporation Ltd 23 Bldg 115 Lane 572 Bibo Road Zhangjiang Hi Tech Park Shanghai CHINA Tel 86 021 5080 3866 Fax 86 021 5080 4600 EM78612 Universal Serial Bus Microcontroller
32. rrrr ooir ORR IOCR gt A None lt Note1 gt R2 A R2 O 0000 0010 0000 0020 Bits 8 9 of R2 unchanged Z C DC 32 e Product Specification V1 0 03 22 2006 This specification is subject to change without further notice Or EM78612 Ralls Universal Serial Bus Microcontroller 0 0010 OOrr rrrr ORAR AvVR5A Lx 0 0010 Orr rrm OR R A AvVR gt R LU a O 0010 10m rrrr AND AR A amp R gt A 2 O 0010 tim rrrr AND R A A amp R gt R 2g 0 0011 Orr rrrr XOR RA A R gt R 2 0 0101 10m rmm DJZA R R 1 A skip if zero 0 0101 tir mm DJZ R R 1 R skip if zero mum s mum t SNC Dee mmm amem 09 EE O01 0t mr 0111 Orr rrrr om SWAPR H R 3 eR47 0 3 o R 4 7 woe PC 1 gt SP 1 OOkk kkkk kkkk kkk CALL k Page k gt PC 1 O1kk kkkk kkkk 1kkk JMP k Page k PC Noe Product Specification V1 0 03 22 2006 e 33 This specification is subject to change without further notice NINI NIJININITGTFnN NEN NIN EM78612 NM OM Doo A 1 1010 kkkk kkkk 1Akk AND A k A amp kOA Z 1 1011 kkkk kkkk 1Bkk XOR A k AOkA Z 1 1100 kkkk kkkk 1Ckk RETLk k2 A Top of Stack gt PC None 1 1101 kkkk kkkk 1Dkk SUB A k Z C DC 11111 kkkk kkkk 1Fkk ADDAK Z C DC C Code Option Register 34 e Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller e EM78612 has one CODE
33. sters are read only while others are both readable and writable RO Indirect Address Register Default Value OB 0000 0000 RO is not a physically implemented register Its major function is to be an indirect address pointer Any instruction using RO as a pointer actually accesses the data pointed by the RAM Select Register R4 R1 Time Clock Counter Default Value OB 0000 0000 This register TCC is an 8 bit timer or counter It is readable and writable as any other register The Timer module will increment every instruction cycle The user can work around this by writing an adjusted value The Timer interrupt is generated when the H1 register overflows from FFh to 00h This overflow sets bit TCIF RF O The interrupt can be masked by clearing bit TCIE IOCF O After Power on reset and WatchDog reset the initial value of this register is 0x00 Product Specification V1 0 03 22 2006 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller R2 Program Counter amp Stack Default Value OB 0000 0000 The EM78612 Program Counter is an 11 bit long register that allows access to 2K bytes of Program Memory with 5 level stacks The eight LSB bits 00 07 are located at R2 while the one MSB bits 10 is located at R3 5 The Program Counter is cleared after Power on reset or WatchDog reset The first instruction that is executed after a reset is located at Address OOh
34. sume signal is detected on USB Bus 7 7 Interrupt The EM78612 has two interrupt vectors one is in 0x0001 and the other is in OxOOOA When an interrupt occurs while the MCU is running it will jump to the interrupt vector 0x0001 or 0x000A and execute the instructions sequentially from interrupt vector RF is the interrupt status register that records the interrupt status in the relative flags bits The interrupt condition could be one of the following 1 TCC Overflow When the Timer Clock Counter Register R1 overflows the status flag RF 0 will be set to 1 Its interrupt vector is 0X0001 2 EPO Interrupt When the UDC successfully received a setup transaction from host to EndPointO the status flag RF 1 will be set to 1 Its interrupt vector is OXOOOA 3 USB Suspend When UDC detects a USB Suspend signal on USB bus the status flag RF 2 will be set to 1 Its interrupt vector is OXOOOA 4 USB Reset When the UDC detects a USB Reset signal on USB bus the status flag RF 3 will be set to 1 Its interrupt vector is OXOOOA 5 USB Host Resume When UDC detects that the USB bus has left the Suspend condition the status flag RF 4 will be set to 1 Its interrupt vector is 0X000A 6 Port 5 State Change When the input signals in Port 5 changes the status flag RF 5 will be set to 1 Its interrupt vector is 0X0001 IOCF is an interrupt mask register which can be set individually bit by bit While their respective bit is written t
35. supply e Pull up source for the external USB resistor on D pin B Package Type e 16 pin PDIP 300MIL SOP 150MIL EM78612 AP AM e 18 pin PDIP 300MIL SOP 300MIL EM78612 BP BM e 20 pin PDIP 300MIL SOP 300MIL EM78612 CP CM e 20 pin SSOP 209MIL EM78612 FM 3 Applications This microcontroller is designed for USB low speed device application or non USB embedded device It is also suitable for PS 2 mouse application Product Specification V1 0 03 22 2006 e 5 This specification is subject to change without further notice EM78612 Universal Serial Bus Microcontroller 4 Pin Configuration EM78612A P61 P60 P62 P64 P63 P65 P70 P71 P72 D P50 VSS D P51 V3 3V VDD OSCI OSCO EM78612B x P60 10 P64 P61 12 P65 P6213 P66 P63 4 P67 P7015 P71 P7216 D P50 Vss 7 D P51 Vsav 8 VoD OSCI 9 OSCO EM78612C x P60 10 P64 P61 2 P65 P6213 P66 P63 4 P67 P7015 P71 P7216 P73 NC 7 D P50 Vss 8 D P51 Vsav 9 VoD OSCI 10 OSCO Ce Product Specification V1 0 03 22 2006 This specification is subject to change without further notice Or EM78612 Pals Universal Serial Bus Microcontroller 5 Pin Description OSCI EN 6MHz 12MHz ceramic resonator input OSCO Return path for 6MHz 12MHz ceramic resonator 3 3V DC voltage output from internal regulator This pin should be tied to a 4 7 u F decoupling capacitor to GND Port6 offers up to 8 GIOP pins Va av P60 P67
36. this bit will be set automatically The firmware will clear it as soon as it gets the data from EPO s FIFO Only when this bit is cleared that the UDC will be able to write a new data into the FIFO Therefore before the firmware can write a data into the FIFO this bit must first be set by the firmware to prevent UDC from writing data at the same time This bit is both readable and writable RD EE um FIFO Address mI Default Value OB iust MN _ 0000 EE UAD4 UAD3 UAD2 UAD1 UADO RD 0 4 USB Application FIFO address registers These five bits are the address pointer of USB Application FIFO RD 5 7 Undefined registers The default value is zero RE USB Application FIFO Data Register Default Value OB 0000 0000 T e os pra Dra ra D o HE USB Application FIFO data register contains the data in the register of which address is pointed by RD NOTE For example if we want to read the fourth byte of the EndPoint Zero we will use the adaress of EPO 0x00 and Data Byte Pointer of EPO 0x10 to access it Read the 4rd byte of the EPO FIFO First assign the data byte pointer of EPO register 0X10 with 0X03 MOVA 0X10 MOVRD a Move data in A to RD register MOVA 0X03 MOVRE A Move data in A to RE register Then read the content from EPO FIFO 0x00 4rd byte MOVA 0xX00 MOVRAD A Assign address point to EPO FIFO MOVA RE Read the fourth byte data byte3 of the EPO FIFO MOV A OXOE Read the fi

Download Pdf Manuals

image

Related Search

Related Contents

Einbau- und Betriebsanleitung  Samsung BD-D5100 Инструкция по использованию  Katana 1.1v4 User Guide    SERVICE MANUAL KSH  American Dryer Corp. SL2929 User's Manual  Installer Manual  

Copyright © All rights reserved.
Failed to retrieve file