Hi, I'm having trouble getting my fast read and write strobes out of a AN2135 EZ-USB device. I don't have the code in front of me, but this is basically what I'm doing (note I've set up the ports correctly to drive the read/write strobes). All of the documentation I've seen has been in assembly, so I'm wondering if I'm missing something in the translation to 'C'. I'm trying to do this for bulk transfers... Thanks! xdata BYTE ext_data; // generate fast read: // point to InBuf1 AUTOPTRH = 0x7E; AUTOPTRL = 0x80; AUTODATA = *ext_data; // generate fast read // generate fast write: // point to OutBuf1 AUTOPTRH = 0x7E; AUTOPTRL = 0x40; AUTODATA = 0xFF; // write temp output data *ext_data = AUTODATA; // generate fast write
And what is the trouble? You only say what you're doing, but not how it fails to work as expected. Anyway, the code you show can't possibly be the one you're actually running --- the type of ext_data doesn't match the way you're using it.
I'm failing to get the FRD# and FWR# pins to toggle low (ie so my FPGA connected to the pins never sees read and write commands). oops - the xdata declaration should be more like: // declare external data pointer: xdata BYTE * ext_data; ext_data = 0xFFFF; AUTODATA = *ext_data; etc...