This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PRCMRTCMatchSet & PRCMRTCMatchGet

Other Parts Discussed in Thread: CC3200

I would like to use PRCMRTCMatchGet & PRCMRTCMatchSet to invoke an interrupt when the set time has been reached.  It is not clear to me from documentation and examples how to do this.  How do I enable the interrupt that should be invoked?

.....

PRCMRTCInUseSet();
PRCMIntRegister (RTC_IntHndlr);

PRCMRTCMatchGet(&secs, &msecs);
secs = secs + 10;
PRCMRTCMatchSet(secs, msecs);

....How do I enable the RTC Int handler?

Thank you for your help,

Jill

  • Hi Jill,

    you can use the following API to enable the interrupt.

    PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR);

    
    

    let me know if it resolves your issue.

    Regards,
    Rahul

  • Thank you. That works.
  • Hi to everybody ,

    I'm trying to put inside the data field of my Udp packets a timestamp..

    I'm using RTC for this with PRCMRTCInUseSet ( to initialize) and when I am sending the packets ( before calling sendto) I call this PRCMRTCGet.

    I have enabled the RTC with the function :

    PRCMRTCInUseSet();


    I put it before calling the Client UDP..

    I put :

    unsigned long *secs;
    unsigned short *msecs;




    while (lLoopCount<UDP_PACKET_COUNT )
    {
    // sending packet

    PRCMRTCMatchGet(secs, msecs);


    for (iCounter=0 ; iCounter<8 ; iCounter++)
    {
    uBuf.BsdBuf[iCounter] = (number);
    UART_PRINT("The value in the buffer is BsdBuf[%d]=%d \n\r",iCounter,uBuf.BsdBuf[iCounter]);

    }

    for (iCounter=16 ; iCounter<BUF_SIZE/2 ; iCounter++)
    {
    uBuf.BsdBuf[iCounter] = *secs;
    UART_PRINT("The value in the buffer is BsdBuf[%d]=%d \n\r",iCounter,uBuf.BsdBuf[iCounter]);
    }

    for (iCounter=16 ; iCounter<BUF_SIZE ; iCounter++)
    {
    uBuf.BsdBuf[iCounter] = *msecs;
    UART_PRINT("The value in the buffer is BsdBuf[%d]=%d \n\r",iCounter,uBuf.BsdBuf[iCounter]);
    }



    iStatus = sl_SendTo(iSockID, uBuf.BsdBuf, sTestBufLen, 0,
    (SlSockAddr_t *)&sAddr, iAddrSize);


    if( iStatus <= 0 )
    {
    // error
    sl_Close(iSockID);
    ASSERT_ON_ERROR(-1);

    }
    lLoopCount++;
    number++;
    }


    Number is only for the first 8 bytes like sequence number of the packets.. But I can't see the time.. I have always zero..

    Where is the mistake for you ?

    Secs and msecs are unsigned long.. How Can I put inside the buffer ?
    Must I activate a conversion or something ?
    For example I can separate in parties the variable secs ( I don't know if it is correct..but for example I have the buffer with dimension 32 byte.. How Can I use 16 byte for the variable secs ?? )

    The general Question is how can I put inside the buffer the information about the time ??

    Thanks for your help

    Best Regards

    Luca Rossini
  • Hi Luca

    I hope isn't to late to help you.

    By your code I see that you're missing call the API PRCMRTCSet(); with this API you pass the start reference to RTC, this API is explained in the prcm.h and prcm.c in the CC3200 SDK.

    Regards, Juan.
  • Hi Jill

    I know that this post has more than a year but I hope you can help me, I trying to implement the same that you did but I'm having troubles in the function PRCMIntRegister(RTC_Handler); I don't know if you did something special or call the API on a speciall order. My code hangs on this part and start to enter the RTC_Handler when I don't even have enable the interrupt with PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR); that Rahul mentions.

    Regards, Juan