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.

Using DIP to control application

Other Parts Discussed in Thread: TMS320C6748

Hello,

I'm building a standard audio filtering application on C6748 with CCS5.

The application uses double buffering and performs the FIR processing when a buffer is full.

The application is working fine, but I now want to add the ability to control it using the DIP switches on board. 

To see that I know how to read the switches' status I added the following section inside the FIR (audio processing section):

DIP_get(0, &tmp_val);
if (tmp_val == 1)
	LED_turnOn(LED_1);
else
	LED_turnOff(LED_1);

This caused the application to fail (the output was corrupted). Can you explain why? Can it be that these few lines are taking to long and create RT problems?

To try and solve the problem, I tried using this code as an idle thread. This did not have any impact on the output audio, but it only worked at application startup - meaning if the switch was off before the application started then the LED would be off, and if it was on when the application started, the LED would be on. Changing the switch status during application runtime did not cause any changes in the LED.

Can someone please help me understand what is the best way to poll on the switches' status during runtime?

Alternatively, is there a way to define a HWI based on a switch status change?

Thanks,

Matan

  • Matan,

    It should work, your piece of code is not enough to give technical suggestion.

    Go to LogicPD's web site. Click on the Kit Contents tab, at the bottom of the page click at:
    TMS320C6748 SOM-M1 GEL, CCS Setup, & BSL Files - you will need to create an account in their website if you do not have one already and download the files.
    The basic LED and DIP example will be at: TMS320C6748_GEL_BSL_Files

    After get the test code from LogicPD's web site, Please have a look at the below path.
    evmc6748_v1-1\tests\experimenter\led_dip
    evmc6748_v1-1\bsl\src

    You can take as reference and add the LED,DIP function calls on your custom code.

    Kindly refer the below wiki for C6748
    http://processors.wiki.ti.com/index.php/How_to_connect_to_the_OMAP-L138/C6748/AM1808_EVM_board_using_CCS%3F

  • Hello Pubesh,

    I already tried these tests and they work fine. The problem is that in the tests there is only one thread - the main thread, and it is reaches an endless loop that samples the DIP status.

    In my application there are other threads and I need to decide how to add the DIP status polling to my code.

    The options I could think of were:

    a. Add it as a function in the idle thread.

    b. Add it as a part of the audio processing (meaning, check the DIP status each time processing begins).

    As I explained in my previous post, both methods did not work. The first only checked the DIP status at the beginning of the program, and did not enter the idle thread again. The second corrupted the output (possibly because the DIP status polling is taking too long).

    I hope my problem is now clearer. Would appreciate your thoughts on the subject.

    Thanks,

    Matan

  • Anyone? Someone?

    Matan

  • Matan,

    Will you share  your custom code of DIP? You need to check the flow of code.

    At the start of main call itself, complete the LED_init() and DIP_init().

    Write a task for DIP and set the priority lower than audio processing task.

    The DIP_get, CHKBIT, SETBIT, LED_turnOn and LED_turnOff function calls are coming into the task routine.