Hardware Reference
In-Depth Information
movlw controlINlow
movwf FSR0L
movlw controlINhigh
movwf FSR0H
call ReadEepromInc
movff EEDATA,DescriptorPointer ;first byte is the length of the string
movff EEDATA,WREG
rlncf WREG
;multiply string length with 2
bcf WREG,0
incf WREG
incf WREG ;add 2
movff WREG,POSTINC0 ;first byte is descriptor length
incf ByteCounter
movlw 0x03
movff WREG,POSTINC0 ;second byte is descriptor type 0x03 = string
descriptor
incf ByteCounter
; next bytes are characters in UNICODE
IN_StringDescriptor_next_byte
call ReadEepromInc
movff EEDATA,POSTINC0
incf ByteCounter
clrf WREG
movff WREG,POSTINC0
incf ByteCounter
decfsz DescriptorPointer,F
bra IN_StringDescriptor_next_byte
; set the byte counter to string descriptor packet length
movlw 0x05
movwf
FSR0L
movlw 0x04
movwf FSR0H
movff ByteCounter,WREG
movff WREG,POSTDEC0
; return ownership to SIE
; set DATA1 packet and return ownership to SIE
movlw 0xC0
movff WREG,INDF0
return
Aufbau der String Deskriptoren des Beispielgeräts
Der Inhalt der vorstehenden drei String Deskriptoren kann vom Anwender geän-
dert werden, damit Herstellername, Typenbezeichnung und Seriennummer ange-
passt werden können. Deswegen stehen diese Daten im EEPROM des Geräts. Jeder
String ist hier in ASCII abgelegt und darf 31 Zeichen lang sein. Beim Übertragen in
den Control-IN Endpoint wird der Text automatisch in UNICODE umgewandelt.
Als Platzhalter sind nach dem Programmieren der MCU des Beispielgeräts die fol-
Search WWH ::




Custom Search