Sign in

username:

password:



Not a member?

Search c3x



Search tips

Subscribe to c3x



c3x by Keywords

Boot | C31 | TMS320VC33 | VC33

Ads

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | TMS320C3x | How to convert tha data to analog form

Technical discussions about the TI C3x DSPs (including the C31, C32 and C33 DSPs).

  

Post a new Thread

How to convert tha data to analog form - Tang...@hotmail.com - Apr 9 8:48:11 2009

I am a newcomer of TMS320C31. I am facing a problem to convert the data
stored from memory address 0x809d00 to 0x809d7f to analog form so that it can be
came out through the output port to a speaker. What is the additional codes
needed? Thank you very much. The codes i done so far are shown in below. 

/*SHIFT.C - ILLUSTRATES 180 DEGREES DELAY IN PHASE */
#include "math.h"
#define pi 3.1415926           
#define Fs 25000
#define inp 1000*sin(2*pi*T*1000/Fs)

main()
{
 int T;
 double xin, x, yo;
 
 volatile int *IO_OUTPUT = (volatile int*) 0x809d00;
 volatile int *IO_INPUT = (volatile int*) 0x809d80;
 for (T = 0; T < 128; T++)
  {             
   xin = inp/1000;           /*input between 1 and -1     */
   if (yo >= xin)            /*is signal falling or rising*/
     x = acos(xin);          /*signal is falling          */
   else                      /*otherwise                  */
     x = asin(xin) - (pi/2); /*signal is rising           */
   x = x - (pi);             /*shift by 180 degrees       */
   *IO_OUTPUT++=1000*cos(x); /*shifted output value       */
   yo = xin;                 /*store xin value            */
  }

for (T = 0; T < 128; T++)
  {             
   xin = inp/1000;           /*input between 1 and -1     */
   if (yo >= xin)            /*is signal falling or rising*/
     x = acos(xin);          /*signal is falling          */
   else                      /*otherwise                  */
     x = asin(xin) - (pi/2); /*signal is rising           */
   x = x ;                   /*shift by 0 degrees         */
   *IO_INPUT++=1000*cos(x);  /*shifted output value       */
   yo = xin;                 /*store xin value            */
  }

}

_____________________________________





(You need to be a member of c3x -- send a blank email to c3x-subscribe@yahoogroups.com )