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.

Integrating Audio Codec with FaceDetect App

My lab is using 15 of the C6748 LCDKs with XDS100 JTAG emulators and CCS5. My  students are trying to use the FaceDetect demo project code to detect colored spheres. At the same time, they want to output a PWM signal to control a servo, based on the position of the sphere in the FOV.

They can successfully identify spheres in one program (using OpenCV), and output a PWM in another, but they cannot combine the two programs into one. If someone has done this before, we would be most appreciative for suggestions. Here is what they have tried:

 Attempt 1. 

A. We made a new hardware interrupt in the main function of the FaceDetect program,

B. We connected the new hardware interrupt to our ISR called PWMIsr().

C. We have a function called pwmsetup() into which we put the transmitting initializations that exist in the function L138_initialise_intr() from L138_LCDK_aic3106_init.c file. We hoped this part would initialize the McASP functionality that we need to output the PWM signal.

D. We enabled the hardware interrupt inside the colorconvertTask function using the Hwi_enableInterrupt function.

E. Inside the Hardware interrupt, PWMIsr(), we tried outputting a signal using the process in the output_left_sample() function from L138_LCDK_aic3106_init.c. The reason why we transferred the code inside those functions instead of calling the base functions themselves given in L138_LCDK_aic3106_init.c was because we were getting an unresolved reference error.

F. This is probably related to "extern void vectors(void);" but we couldn't resolve this linking error.

 

Attempt 2.

A. Next, instead of using the McASP initializations from  L138_LCDK_aic3106_init.c, we tried using functions from the McASP playback project in starterware mcaspPlayBk.c.  

B. And instead of using the HWi initializations given in the FaceDetect code, we tried implementing the EDMA interrupts. While there were no specific errors raised, we could not see any signal from the line output to the oscilloscope. We set a breakpoint in our PWMIsr() and saw that our PWMIsr() is visited once, but never visited again once the code continues.

  • Hi,

    Thanks for your post.

    With reference to Attempt1, I think, you would have called output_left_sample() more than once in the PWM interrupt service routine and probably due to this, you are getting an unresolved reference error. To my opinion, it is unusual to generate PPM/PWM signals through an audio codec instead, I would recommend you to try manipulating a GPIO pin to give a binary output pulse signal. This would be the best optimal solution.

    The demo integrates prebuild OpenCV functions for facedetect and The cxcore library of OpenCV is integrated for identifying the face. So, I would recommend you to see the feasibility of integrating audio codec with facedetect app. and to my knowledge queries on openCV are best handled by TI-RTOS Forum.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------  

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Sivaraj, thank you for your quick response. We are not wedded to using the audio codec, so we will pursue the GPIO route (pin 16 or pin 20 on J15). We will post when successful.

    Regards,

    Mike Briggs
  • Sivaraj, we were successful in using one of the GPIO outputs on J15 for the PWM signal. Thanks for the help.

    Regards,

    Mike Briggs
  • Sivaraj, here's a link to a 13-second video showing a mobile robot (that follows your suggestion of using a GPIO pin) reacting to an obstacle (blue ball) and turning to avoid it: youtu.be/eVvzQ3QmRVc

    Thanks again for your help. We will be carrying this much further in the future.

    Regards,

    Mike Briggs
  • Hi Mike,

    Thanks for sharing your udpate.

    We appreciate your efforts.

    Thanks & regards,
    Sivaraj K