-; usbdux_firmware.asm
+; usbduxfast_firmware.asm
; Copyright (C) 2004 Bernd Porr, Bernd.Porr@cn.stir.ac.uk
;
; This program is free software; you can redistribute it and/or modify
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
;
-; Firmware: usbdux_firmware.asm for usbdux.c
-; Description: xxx
+; Firmware: usbduxfast_firmware.asm for usbdux.c
+; Description: Firmware for usbduxfast
; Devices: [ITL] USB-DUX (usbdux.o)
; Author: Bernd Porr <Bernd.Porr@f2s.com>
-; Updated:
+; Updated: 4 Jan 2005
; Status: testing
;
;;;
lcall syncdelaywr
mov dptr,#IFCONFIG ; switch on IFCLK signal
- mov a,#10110010b ; gpif, 30MHz,
+ mov a,#10100010b ; gpif, 30MHz,
lcall syncdelaywr
mov dptr,#FIFORESET
anl a,#80h ; done bit
jz no_trig ; GPIF busy
+;;; buffer overflow
+ mov dptr,#0F800H ; EP8 fifo buffer
+ mov a,#0ffh ; error
+ movx @dptr,a ; write ffh into the EP buffer
+ inc dptr ; next byte
+ movx @dptr,a ; write ffh into the EP buffer
+ mov dptr,#EP6BCH ; byte count EP6 high byte
+ mov a,#02H ; 512 bytes
+ lcall syncdelaywr ; write to memory and sync
+ mov dptr,#EP6BCL ; byte count EP6 low byte
+ mov a,#0 ; low byte is zero
+ lcall syncdelaywr ; write to memory and sync
+
mov a,#06h ; RD,EP6
mov GPIFTRIG,a
no_trig:
initGPIF:
- mov DPTR,#EP6CFG ; ISO data from here to the host
- mov a,#11010000b ; Valid, quad buffering
- lcall syncdelaywr
+ mov DPTR,#EP6CFG ; BLK data from here to the host
+ mov a,#11100000b ; Valid, quad buffering
+ lcall syncdelaywr ; write
mov dptr,#EP6FIFOCFG
mov a,#00001001b ; autoin, wordwide
mov dptr,#EP6AUTOINLENH
mov a,#00000010b ; 512 bytes
- lcall syncdelaywr
+ lcall syncdelaywr ; write
mov dptr,#EP6AUTOINLENL
mov a,#00000000b ; 0
- lcall syncdelaywr
-
- mov dptr,#EP6ISOINPKTS
- mov a,#1 ; 1 packets
- lcall syncdelaywr
+ lcall syncdelaywr ; write
mov dptr,#GPIFWFSELECT
mov a,#11111100b ; waveform 0 for FIFO RD
;;; initilise the transfer
-;;; It is assumed that the USB interface is in alternate setting 3
+;;; It is assumed that the USB interface is in alternate setting 1
initeps:
mov DPTR,#EP4CFG
mov a,#10100000b ; valid, bulk, out
- movx @dptr,a
+ lcall syncdelaywr
mov dptr,#EP4BCL ; "arm" it
mov a,#00h
mov DPTR,#EP8CFG
mov a,#0 ; disable EP8, it overlaps with EP6!!
- movx @dptr,a
+ lcall syncdelaywr
mov dptr,#EPIE ; interrupt enable
mov a,#00100000b ; enable irq for ep4
- movx @dptr,a ; do it
+ lcall syncdelaywr ; do it
mov dptr,#EPIRQ ; clear IRQs
mov a,#00100100b
.End
+
+
+
+
+
+
+
+
+
+
:1001000002017F0002017F0002017F0002017F00E7
:1001100002017F0002017F0002017F0002017F00D7
:1001200002017F0002017F0002017F0002017F00C7
-:1001300002017F000202C40002017F0002017F0071
+:1001300002017F000202DA0002017F0002017F005B
:1001400002017F0002017F0002017F0002017F00A7
:1001500002017F0002017F0002017F0002017F0097
:1001600002017F0002017F0002017F0002017F0087
:1001700002017F0002017F0002017F0002017FC0B7
:1001800086C082C083C084C085C0E0C0D0E591C273
:10019000E4F591D0D0D0E0D085D084D083D082D087
-:1001A000863290E60B74031203E490E6007410129A
-:1001B00003E490E60174B21203E490E60474801242
-:1001C00003E474081203E474021203E474041203D7
-:1001D000E474061203E474001203E490E668740801
-:1001E0001203E412028B1201FD1201EE80FBE57096
-:1001F000600AE5BB548060047406F5BB2290E614E7
-:1002000074D01203E490E61A74091203E490E62411
-:1002100074021203E490E62574001203E490E642AF
-:1002200074011203E490E6C074FC1203E490E6C388
-:1002300074801203E490E6C274FF1203E474FD12AA
-:1002400003E474FF1203E4740290E6E21203E47420
-:100250000190E6E31203E4740090E6F31203E47401
-:100260000090E6C11203E490E420743F1203E4908E
-:10027000E42874011203E490E43074FF1203E49064
-:10028000E43874FF1203E47570002290E61374A042
-:10029000F090E69574001203E41203E41203E49074
-:1002A000E6157400F090E65E7420F090E65F74242A
-:1002B000F090E65C7400F090E6607400F075E80180
-:1002C00075A88022C086C082C083C084C085C0E07B
-:1002D000C0D0C000C001C002C003C004C005C00639
-:1002E000C00790F400E09002EB23738005800002C9
-:1002F00003A275700090E61A74001203E490E6F50C
-:1003000074FF1203E4E5BB548060FA90E6C074FD0C
-:10031000F01203DA90E60474801203E47406120308
-:10032000E474001203E47406F5BBAAFFDAFE90E65B
-:10033000F574FF1203E4AAFFDAFEE5BB548060FA0D
-:10034000759DE41203DA759E001203DA759AF412B1
-:1003500003DA759B011203DA75AF071203DA7A200C
-:1003600090E67BE01203DA90E67CF01203DADAF032
-:1003700090E61A74091203E490E6C074FCF01203CC
-:10038000DA90E60474801203E474061203E4740045
-:100390001203E490E410E044FB90E6C21203E4751B
-:1003A000700190E6957400F01203DAF01203DAE5BA
-:1003B00091C2E4F59190E65F7420F0D007D006D0AA
-:1003C00005D004D003D002D001D000D0D0D0E0D0EE
-:1003D00085D084D083D082D0863200000000000017
-:0903E000000000221203DAF022F1
+:1001A000863290E60B74031203FA90E60074101284
+:1001B00003FA90E60174A21203FA90E60474801226
+:1001C00003FA74081203FA74021203FA7404120395
+:1001D000FA74061203FA74001203FA90E6687408BF
+:1001E0001203FA12029B1202151201EE80FBE57057
+:1001F0006022E5BB5480601C90F80074FFF0A3F00F
+:1002000090E69874021203FA90E69974001203FAC9
+:100210007406F5BB2290E61474E01203FA90E61A15
+:1002200074091203FA90E62474021203FA90E62588
+:1002300074001203FA90E6C074FC1203FA90E6C34D
+:1002400074801203FA90E6C274FF1203FA74FD126E
+:1002500003FA74FF1203FA740290E6E21203FA74CE
+:100260000190E6E31203FA740090E6F31203FA74C5
+:100270000090E6C11203FA90E420743F1203FA9052
+:10028000E42874011203FA90E43074FF1203FA9028
+:10029000E43874FF1203FA7570002290E61374A01C
+:1002A0001203FA90E69574001203FA1203FA12038D
+:1002B000FA90E61574001203FA90E65E74201203B9
+:1002C000FA90E65F7424F090E65C7400F090E660CB
+:1002D0007400F075E80175A88022C086C082C083D2
+:1002E000C084C085C0E0C0D0C000C001C002C0034F
+:1002F000C004C005C006C00790F400E090030123CD
+:1003000073800580000203B875700090E61A7400CF
+:100310001203FA90E6F574FF1203FAE5BB5480600D
+:10032000FA90E6C074FDF01203F090E604748012B7
+:1003300003FA74061203FA74001203FA7406F5BB8A
+:10034000AAFFDAFE90E6F574FF1203FAAAFFDAFEBE
+:10035000E5BB548060FA759DE41203F0759E0012AF
+:1003600003F0759AF41203F0759B011203F075AF58
+:10037000071203F07A2090E67BE01203F090E67C0F
+:10038000F01203F0DAF090E61A74091203FA90E61C
+:10039000C074FCF01203F090E60474801203FA7447
+:1003A000061203FA74001203FA90E410E044FB9082
+:1003B000E6C21203FA75700190E6957400F012031C
+:1003C000F0F01203F0E591C2E4F59190E65F74203D
+:1003D000F0D007D006D005D004D003D002D001D091
+:1003E00000D0D0D0E0D085D084D083D082D08632E7
+:0F03F000000000000000000000221203F0F022C5
:00000001FF