11.27.2006

Philip USB 2.0 : ISP1583/2 - Initialize

reset後,可以先read Chip ID (70h),datasheet說
byte 0 : version = 0x30
byte 1 : ID - low byte = 0x82
byte 2: ID - high byte = 0x15

所以讀起來就是 0x158230。 (雖然是1583,chip id 也是1582)。
確認bus timing and chip connectin OK。

然後作 register 初始化設定:

ModeReg (0Ch) = 0x0208; DMA Clock ON. Global INT enable
IntConfig (10h) = 0x54; INT on all ACK. NYET
IntEnable(14h) = 0x00000979; IEP0TX. IEP0SETUP. IEDMA. IEHS_STA. IERESM. IEUSP. IEBRST.
DmaConfig(38h) = 0x2201; ATA_Mode. PIOMode1. 8-bit.
DmaIntEnable (54h) = 0x00000979 : ?
DmaConfig
DmaIntEnable

初始 使用到的Endpoint
一部分要分成FULL_SPEED, High_SPEED 的 FIFO buffer size不同

EndpointIndex = 4 : Endpoint Index = 4, direction = 0 (out)
MaxPacksize = 0x0040 : 1 packet per microframe. fifo size : 64 bytes - for Full Speed
// = 0x0200 : 1 packet per microframe. fifo size : 512 bytes - for High Speed
EndpointIndex = 5 : Endpoint Index = 4, dircetion = 1 (in )
MaxPacksize = 0x0040
// = 0x0200

EndpointIndex = 4
EndpointType = 0x0016 : No Empty Packet. Disable. Double Buffer. Bulk.
EndpintIndex = 5
EndpointType = 0x0016

EndpointIndex = 4
EndpointType |= 0x08 : Enable Endpoint
EndpointIndex = 5
EndpointType |= 0x08


DmaEndpoint = 2
EndpointIndex = 5
ControlFunction ?

Address = 0x80 : enable device and clear device address to 0x00 (un-assigned value)

沒有留言: