how to DR_DATA from register

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

cross mob
Anonymous
Not applicable
        now I use DR_DATA of the GPIF from register,GPIF data bus is 16bites. I want to get the register 32bit data to the GPIF data bus for twice. my program as follow *buffer1=0xFF0000FF; apiRetStatus=CyU3PGpifWriteDataWords (1,0,1,buffer,10); in the GPIF ,the two DR_DATA is the same. the result is that it put out FF00 once,but 00FF data can not be getted ? 1 I want to know if it has something wrong with the program . 2 another question is that i want to add the socket number of the DR_DATA , Originally it hao 4 socket to 4 thread in the socket ,i want to know if i can has more socket such as 5 or more ? I want to know if it can realize?   
0 Likes
11 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Hi, You might not have selected the "Update new value from data source" in the DR_DATA action settings. Please use the DR_DATA action settings as shown in the attached figure. I have selected "Thread 1" since you are using Socket 1 in the "CyU3PGpifWriteDataWords" API. Thread, socket mapping is as follows: Thread 0 - socket 0 - socket 4, Thread 1 - socket 1 - socket 5, Thread 2 - socket 2 - socket 6, Thread 3 - socket 3 - socket 7, (Socket number) modulo 4 is the thread number mapped to it. Please let me know if you still have some doubts in using DR_DATA. Thanks, sai krishna.   
0 Likes
Anonymous
Not applicable
        NO ,my configure of DR_DATA is the same as your picture   
0 Likes
Anonymous
Not applicable
        I want to ask when use DR_DATA one time how many data will the read from regist? now the data I write to the rigister is 32bits, but I want to get the data for twice , 16bits once. So I must use DA_DATA for two times ? if it can realize?   
0 Likes
Anonymous
Not applicable
        you say Thread 0 - socket 0 - socket 4, Thread 1 - socket 1 - socket 5, Thread 2 - socket 2 - socket 6, Thread 3 - socket 3 - socket 7 if it is needed to be configured ? i want to get data from socket which i want to get from,so it must be under my control,if it can be realized?   
0 Likes
Anonymous
Not applicable
        Hi, Yes. You need to do DR_DATA twice. Please use the attached project for your reference. Please go through the code present in SlFifoAppThread_Entry(). Thanks, sai krishna.   
0 Likes
Anonymous
Not applicable

I move the code to SlFifoAppThread_Entry() 

   

my GPIF project follows

   

void
SlFifoAppThread_Entry (
        uint32_t input)
{
 CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;
 uint32_t *buffer1=0;
 *buffer1=0x0000FF00;
    /* Initialize the debug module */
    CyFxUhpiDebugInit();
    //CyU3PDebugPrint (4, "CyFxUhpiDebugInit success,code = %d\n",1 );
    /* Initialize the GPIF */
    CyFxGpioInit();
    //CyU3PDebugPrint (4, "CyFxGpioInit success,code = %d\n",2 );
    //uint16_t ENdian;
    //CY_U3P_GPIF_BYTE_ENDIAN=0x0001;

   

    /* Initialize the GPIF */
    CyFxUhpiGpifInit();

   

    /* Initialize the slave FIFO application */
    CyFxSlUhpiApplnInit();

   

    //CyU3PDebugPrint (4, "CyFxSlUhpiApplnInit success,code = %d\n",3 );

   


   apiRetStatus=CyU3PGpifWriteDataWords (0,0,1,buffer1,10);
    CyU3PDebugPrint (4, " CyU3PGpifWriteDataWords, Error code = %d\n", apiRetStatus);
    CyU3PGpifControlSWInput(CyTrue);
    CyU3PThreadSleep (100);

   

in this way ,my Oscilloscope read the data bus nothing ,the date  writes successfully ,so i want to know if  the configure of theCyU3PGpifWriteDataWords is right ,  I have test the bits get for one time,16bits one time ,so if you have a example that can do success ?

0 Likes
Anonymous
Not applicable

I'm sorry . there is data in data bus when move the code to SlFifoAppThread_Entry(). today I use 32bit data bus it put out right , but when i sent two 32bit data ,but it can not refresh the data 

   

 uint32_t *buffer1=0;
 uint32_t *buffer2=0;
 *buffer1=0x00FFFF00;
 *buffer2=0xFF0000FF;

   

   apiRetStatus=CyU3PGpifWriteDataWords (0,0,1,buffer1,10);
    CyU3PDebugPrint (4, " CyU3PGpifWriteDataWords, Error code = %d\n", apiRetStatus);
    CyU3PGpifControlSWInput(CyTrue);

   

   apiRetStatus=CyU3PGpifWriteDataWords (0,0,1,buffer2,10);
    CyU3PDebugPrint (4, " CyU3PGpifWriteDataWords, Error code = %d\n", apiRetStatus);
    CyU3PGpifControlSWInput(CyTrue); 

   

I can get the first data ,but the second data lost. so can I Initialize the register?

0 Likes
Anonymous
Not applicable
        Hi, Attachment was not uploaded. Sorry for that. Attaching again...   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
0 Likes
Anonymous
Not applicable

 uint32_t  tmp_data[4] ={0x55, 0x22, 0x11, 0x44};I'm not very clear about this, the data type is not  the same to  the data, it whether indicate that the register can transfer 16 bits for one time ?

0 Likes
Anonymous
Not applicable

Hi,

   

Did the attached project help you?.

   

Please let me know if you have any more questions regarding this.

   

Thanks,

   

sai krishna.

0 Likes