beautypg.com

Maxim Integrated MAXQ622 User Manual

Page 187

background image

MAXQ612/MAXQ622 User’s Guide

Maxim Integrated

12-17

12.5.2 USB Example 2: Writing to an Internal USB Register (EP2BC)

To write to the USB state registers, the user will write the destination register offset to UADDR, write data to UDATA
register, and wait for UBUSY to clear to complete the operation .
;; writing to USB register
MOV UADDR, #EP2BC

; Read EP2BC register, #EP2BC = 12h

;

(RW=0,

ADDR=10010

MOV UDATA, #0010h

; Write 0010h to the EP2BC register

CHK: MOV

C, UADDR.6

; Loop to check UBUSY flag

JUMP NC, CHK

; and wait for it to clear

Figure 12-5. Writing to an Internal USB Register

CPU_CLK

CPU WRITE

REG_ADDR1

CPU WRITE

UDATA1

SET UBUSY = 1

CPU READS

UBUSY = 0

CPU WAIT

UADDR[4:0]

UDATA[7:0]

USBRW

UBUSY

SIE_CLK

SIE_DATA[7:0]

SIE_UBUSY

REG_ADDR1

UDATA1

UDATA1

CLEARS CPU UBUSY

SIE WRITES

UDATA1

This manual is related to the following products: