Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Philips ISP1581 DATACOUNT and DATAPORT registers

Status
Not open for further replies.

al78

Newbie level 4
Joined
Feb 17, 2005
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
isp1581 setup

Hello all,
I've asked a question one week ago and I haven't answer yet. Maybe I was not clear enough with my question, so I will ask You again:
The problem is, that when I receive a GET_DESCRIPTOR device request I should respond to the host with the first 8 bytes from the device descriptor. I'm using the sample from Philips for the ISP1581 chip. The function is WriteControlEndpoint:
WORD ISP1581_WriteControlEndpoint(BYTE * buf, WORD len)
{
WORD i;
unsigned short c,p;
WORD32 q;
ISP1581_SetEPIndex(EPINDEX4CONTROL_IN);
usb->buffer_length.DATACOUNT = len;
/* Write Buffer */
for(i=0; i<len; i=i+2, buf++ )
{
c = *buf;
buf++;
c += (unsigned short)(*buf << 8);
usb->data_port.DATAPORT = c;
}
return len;
}

The problem is, that in my oppinion the host doesn't receive the data which I've sent to him, because when I read from the DATACOUNT and DATAPORT data I'm receiving only zeroes.

Does anybody has any idea why I can't write or read to the registers?
(just for the protocol, there are registers from which I'm reading/writing successfuly)

Thank you all in advance,
Best reagrds,
Al
 

isp1581 endpoint size

The usb enumeration process can't be interrupted.
If you did, the host will time out and abort the process.
 

isp1581

Hello,
I'm not interrupting the enumeration process.
In fact, the problem is, that in my oppinion, the data which I'm writing to DATAPORT and DATACOUNT is actually not written...
 

isp1581 endpoint 6 receive problems

About DATAPORT register, it said that 'This 2-byte register provides direct access for a microcontroller to the FIFO of the indexed endpoint', so data writing to the FIFO can't be read out correctly because of the property of FIFO.
As for DATACOUNT register, you can modify the code to verify.
......
usb->buffer_length.DATACOUNT = len;
len = usb->buffer_length.DATACOUNT; // to see if len = 0?
......
 

isp1581 bus reset interrupt

Hello,
I have made before the test with the DATACOUNT.
When I save for example 0x8 in the DATACOUNT and immediately try to read it, I'm receiving zero.
That's why I think that I can't write, but why?...

Regards,
Al
 

isp1581 control endpoint

Try to read-write the DATACOUNT register in the memory window of the debugger directly.
And try other registers too.
 

philips isp1581

Hello,
I've managed to write the data in the DATACOUNT register.
The problem was that I have not set the bit EP0SETUP in the endpoint register to zero.
Now I can see, that I'm transferring the data through the D+ line.
But the problem still stays:
After the transfer of the data I'm receiving again 2 times the bus reset, hs_stat and setup interrupts.
The setup request is AGAIN for the device descriptor which I have sent to the host in the previous setup interrupt.
Do you have any idea why this is happening?
Should the host acknowledge that I have sent to him the device descriptor or not?
I'm wondering where to put the setting of the STATUS bit - after the writing to the control endpoint or after I receive some kind of acknowledge (which I'm not receiving)

Thanks for your help,

Best regards,
Al
 

The device descriptor is longer than 8 bytes. The first request (for only eight bytes) is to get maximum EP0 packet size. After that, there is a request for the full device descriptor, which may require a multipacket transfer.
 

Hello,
Yes, I'm waiting for the second request for the device descriptor, but unfortunatelly the problem is that I'm not receiving second request for the descriptor.
The sequence is as follows:
I'm receiving 3 interrupts:

Bus reset
Change speed - full speed/high speed
Setup request (for the device descriptor)

These 3 interrupts are repeated 2 more times and after that there is no more interrupts from the host.
In fact, this is the problem, which I'm facing.

Thank to all for the support,
Best,
Al
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top