LP-EM-CC2340R5: NEC Decoder implementation in CC2340R5

Part Number: LP-EM-CC2340R5
Other Parts Discussed in Thread: SYSCONFIG,

Hi Team, 

We are attempting to Interface an IR Receiver with the LP-EM-CC2340R5 board. I tried by setting LGPT3 timer's Channel 0 on Pulse width Capture Mode. I set the input trigger as both edges. All these settings are updated in the LGPT params structure and initialized into an handle. I am building this by combining the basic_ble_project and the empty project. I set the trigger Pin Header by setting the Channel in pinmode and setting the pin to DIO24 in the sysconfig file. However, the callback function isn't triggered when I give a IR command to the receiver. 

  • Hi Manomukil,

    Could you pls share your Sysconfig file, to help the support team identify the issue?

    Regards,

    Chander

  • Hi Chander,

    PFB the sysconfig file.

    sysconfig.zip

    Regards,

    Manomukil T

  • Hi Manomukil,

    Thank you for providing your SysConfig file, can you also provide a basic example of your LGPTimerLPF3.h implementation to replace empty.c which recreates the issue?  Make sure you have followed all of the guidelines listed below:

    LGPTimerLPF3_CH_PULSE_WIDTH_MEASURE 

    Period and pulse width measurement.

    Continuously capture period and pulse width of the channel input signal relative to the signal edge selected by the ch<x>InputEdge element in the LGPTimerLPF3_Params structure. The channel number dependent interrupt status flag (LGPTimerLPF3_INT_CH0_CC for channel number LGPTimerLPF3_CH_NO_0) will be set when the signal period and pulse width have been captured. The period and pulse width are reported in numbers of counter ticks. The LGPTimerLPF3_getChCompareVal() function returns the measured period and the LGPTimerLPF3_getNextChCompareVal() functions returns the measured pulse width.

    Note
    Note that when selecting this channel action, LGPTimerLPF3_start() function must be called with either LGPTimerLPF3_CTL_MODE_UP_ONCE or LGPTimerLPF3_CTL_MODE_UP_PER as function argument.
    Note that the timer counter restarts regularly when this action is used, so other channel actions must be chosen with this in mind. The timer counter restarts when the period of the channel input signal has been captured.
    If multiple channels are configured with this channel action, the measurements are not performed simultaneously on the channels. The measurements are done in a time-interleaved manner between the channels.

    Signal property requirements for this channel action:

    • Signal Period >= 2 * (1 + params.prescalerDiv) * high frequency clock (CLKSVT) period.
    • Signal Period <= MAX(timer counter) * (1 + params.prescalerDiv) * high frequency clock (CLKSVT) period.
    • Signal low and high phase >= (1 + params.prescalerDiv) * high frequency clock (CLKSVT) period.

    Otherwise, I suggest observing behavior when one input edge is selected as the trigger.

    Regards,
    Ryan

  • Hi Ryan, 

    Here is the empty.c file with the timer code

    empty.zip

    Regards,

    Manomukil T

  • Hi Manomukil,

    Thanks for providing the SysConfig file and modified empty.c file. I am going to replicate your setup on my end and attempt to recreate the behavior you are seeing so I can give you some advice on how to resolve the issue!

    Thanks,

    Luke

  • Hi Manomukil, 

    I was having trouble building the project with the provided sysconfig file you shared. However, I was able to take the empty.c file and an empty sysconfig file from the SDK with an added instance of LGPTimer to get it to build and run successfully. I have not been able to spike out the exact issue yet but I do have some concerns with the implementation of your timerCallback function. I may be able to dive deeper into debugging on my end if you could provide any additional files you may have added to your project as you combined the empty and basic_ble projects. 

    Have you attempted observing behavior when one input edge is selected as the trigger as Ryan had also mentioned previously?

    Thanks,

    Luke

  • Hi Luke, 

    PFB the entire project. I am using an IRM3638 IR Receiver to interface with the TI board. Even when I set one input edge as trigger, The callback function isnt being called. 

    Regards,

    Manomukil Tir.zip

  • Manomukil,

    Thanks for sharing the project and the receiver you are working with. This should be helpful in debugging the issue you are running into better. I will look into why the callback function isn't being called and get back before the end of the week.

    Thanks,

    Luke

  • Manomukil, 

    I have not had much success in simulating your issue with the IR receiver interfacing with the board but similarly am not getting any response with your timerCallback function at all. I am going to pick this back up after the holidays in early January and see if we can find a resolution for this problem. My best recommendation for now would be to try and simplify the callback function to see if you can get it called upon with an easier case and then debug adding additional features later on.

    Thanks,

    Luke

  • Manomukil,

    Do you have any updates towards a resolution for this issue?

    I can continue working on my end if necessary but want to check in with you on any progress first.

    Thanks,

    Luke

  • Hi Luke,

    I tried to go back to basics by calling the interrupt handler to just make the LED glow at a rising high GPIO trigger and turn off at a rising low GPIO trigger. But I am not able to get that itself working and I am trying to debug that solution.

    Regards,

    Manomukil T

  • Hi Manomukil,

    Could you share your simplified function/code with me so I can see if I notice any errors or issues that may help in debugging?

    Thanks,

    Luke

  • Hi Luke,

    PFB the zip file for the same. 

    4628.ir.zip

    Regards,

    Manomukil T

  • Manomukil,

    Thanks for sharing your code. I will look into it and see what I can find.

    Thanks,

    Luke

  • Manomukil,

    I am able to get the LED to flash on whenever running your program in debug mode but as soon as I pause the program, the LED turns off and I am seeing that the GPIO index is invalid which leads me to believe there may be issues in your configuration files. These errors are likely with the LED as well as other aspects that may have occurred when combining the basic_ble and empty projects as well as adding in your own changes. I am going to continue to look through the sysconfig and other changes to see if I can locate the problem but I am not certain how quickly I will be able to resolve the issue.

    Thanks,

    Luke

  • Hi Luke

    Were you able to make progress?

    Regards,

    Chander

  • Chander, 

    I have not made any progress since my attempt to get the LED to flash and running into the indexing issue. I cannot tell where the specific issue within the configuration is occurring based on the shared project.

    Have there been any more updates on your side in regards to progress on the timerCallback function actually being called when interfacing with the IR receiver or is the timerCallback function still not working at all?

    Thanks,
    Luke