I have a project that I am developing using the FX2 platform to read an I2C based encoders. The system will host five different encoders which are read by the I2C bus and I would like to read their data buffer and place into a buffer to be read back by the computer when you do a bulk read. This way each transaction on the USB bus yields the buffer contents of all five encoders. I was trying to write the return of EZUSBReadI2C into EP2FIFOBUF but EP2FIFOBUF won't accept the data.
I was able to get the firmware to work the way I would like it to. Thank you for the help. To correct the return value changing from the default value to 1 instead of incrementing the default value when the encoder is turned, I added a second programming of the initial values using a EZUSB_WriteI2C(encoder, 17, (WORD)Setup_Data); . Not reala second time. I am not sure why this works but it does. To get the unit to load defaults without a Vendor Request I added if(!(ENCODER_RDY))initialize_encoder(); to TD_Poll(). Now when I plug the unit in the encoders read correctly and there is no need for a vendor request unless you want to reset the default values. Thanks for all the help!