This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems with EP0 OUT

I trying to write a very basic sanity test that uses two Vend Req (0xC2 and 0xC6) to output 4 bytes then read them back. (Using a FX2LP)

Using the framework... The vend request code is as follows :

 switch (SETUPDAT[1])
  {
     case VX_C2: // write
        {
          SYNCDELAY;
          keep[0] = EP0BUF[0];
          SYNCDELAY;
          keep[1] = EP0BUF[1];
          SYNCDELAY;
          keep[2] = EP0BUF[2];
          SYNCDELAY;
          keep[3] = EP0BUF[3];
          SYNCDELAY;
          EP0BCH = 0;
          EP0BCL = 0;
          EP0CS |= bmHSNAK;
          break;
             }

    case VX_C6: // read
                {
          EP0BUF[0] = keep[0];
          EP0BUF[1] = keep[1];
          EP0BUF[2] = keep[2];
          EP0BUF[3] = keep[3];
          SYNCDELAY;
          EP0BCH = 0;
          SYNCDELAY;
          EP0BCL = 4;
           EP0CS |= bmHSNAK;
          break;
        }
     default:
        return(TRUE);
  }


"keep" is defined a global (outside all functions):

BYTE keep[4];

From various debug it appears that the data on the "write" (OUT) vend reqs is not available in the EP0BUF and therefore is not being copied into keep[0-3]. If I hard wire various values (instead of reading EP0BUF) and see them propagate through to the "read" Vend request (IN) so I know that side is working.

I'm exercising the vend request with the standard CyConsole.

Any thoughts on what I might be missing to this basic flow working would be very much appreciated.

Parents Reply Children
No data