It should be criticized: support system of Cypress'es Literature for USB

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am a novice to use Cypress's chips with full speed USB. I fell that it is very difficult to get started with full speed USB in Psoc 1 system.

   

Thereare many literatures for  full speed USB of PSOC 1, however vague, or even wrong.

   

For example, "USB Full Speed Device Datasheet USBFS V 2.10" in PSOC Dedigner 5.4, it give a Sample Firmware Source Code, the only sample in C:

   

#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules

   

BYTE abMouseData[3] = {0,0,0};
BYTE i = 0;
void main (void)
{
M8C_EnableGInt; //Enable Global Interrupts
USBFS_Start(0, USB_5V_OPERATION); //Start USBFS Operation using device 0 at 5V
while(!USBFS_bGetConfiguration()); //Wait for Device to enumerate
USBFS_LoadInEP(1, abMouseData, 3, USB_NO_TOGGLE); //Begin initial USB transfers
while(1)
{
if(USBFS_bGetEPAckState(1) != 0) //Check and see if ACK has occured
{
USBFS_LoadInEP(1, abMouseData, 3, USB_TOGGLE); //Load EP1 with mouse data
if(i==128)
abMouseData[1] = 0x05; //Start moving the mouse to the right
else if(i==255)
abMouseData[1] = 0xFB; //Start moving the mouse to the left
i++;
}
}
}

   

BYTE abMouseData[3] = {0,0,0};
It is wrong! The data can be received by WINDOWS is:

   

abMouseData[4] = {0,0,0,0};
Such a stupid mistake brought a lot of confusion for beginners.

   


 

0 Likes
4 Replies
Anonymous
Not applicable

Furthermore,There are also some problems with  "USBFS Setup Corresponding to the Example Code" in the  literature:

   

it is actually no introduction for how to set Report descriptor in the template, no example.

   

So the literature is not practical enough.

   

If you want to operate USB, you must learn many other book, take many detours.

   

In fact, this can be avoided. It can also help to get more customers for CYPRESS.

0 Likes
Anonymous
Not applicable

There is no using example for Many API Functions. Lack of demo samples, instead, the general introduction is toomuch.

0 Likes
ShopithamR_26
Employee
Employee
25 replies posted 10 replies posted 5 replies posted

 Hi,

   

The abMouseData[] array should only be 3 bytes .

   

The HID Mouse Descriptor used for the example project is a 3 button mouse descriptor . The descriptor defines information about left click , right click , middle button click , X Co-ordinate and Y Co-ordinate . The Left click , right click and middle click each needs one bit representation .The X and Y co-ordinate needs 1 byte each . So in total we need only 3 bytes of data to be sent to PC.

   

I dont understand why you need to send 4 bytes of data . Are you planning to use wheel for scrolling purpose ? In that case you will need 4 bytes .

   

-sobi

0 Likes
Anonymous
Not applicable

It seems that you do not do the experiment.

   


The problem is that y WINDOWS does not identidy array[3], then people do not understand what went wrong.

0 Likes