Welcome to the C2000™ Microcontrollers Section of the TI E2E Support Community. Ask questions, share knowledge, explore ideas, and help solve problems with fellow engineers. To post a question, click on the forum tab then "New Post".
Hi
I decided to implement Fast Fourier Transform in TMS320LF2407A DSP. I download the FFT library (sprc069) and tried to used the c-callable module as it has been describe in the related document. For testing my code, I tried to apply the FFT on a specific signal (one period of sinusoidal or square wave) and compare the result with the MATLAB. The result is completely different!! (I know the input of the FFT lib is in Q15 format and output is in Q14 format).
my code is the same as what is mentioned in the FFT lib document::
#pragma DATA_SECTION(aiDataLog1_g, "data_log");
int aiDataLog1_g[DATA_LOG_LEN];
#pragma DATA_SECTION(aiDataLog2_g, "data_log");
int aiDataLog2_g[DATA_LOG_LEN];
#pragma DATA_SECTION(fft_test, "int_ram");
FFT128R fft_test=FFT128R_DEFAULTS;
// Creating a specific signal as input
// getSin() output is in Q15
for (iTemp=0; iTemp<128; iTemp++) {
aiDataLog1_g[iTemp] = 0.5*getSin(258*iTemp);
}
// FFT calculation
/* FFT initialization */
fft_test.ipcbptr = aiDataLog1_g; /* FFT computation buffer */
fft_test.magptr = aiDataLog2_g; /* Store back the mag. square */
//fft.winptr=win; /* Window coefficient array */
fft_test.init(); /* Copy Twiddle factor */
/* Acquire samples in bit reversed order or
Bit-reverse the in-order data using bit-rev utility */
FFTC_brev1(fft_test.ipcbptr, fft_test.ipcbptr, 128);
/* FFT Computation */
//fft_test.win(&fft_test); /* Window the input data */
fft_test.izero(&fft_test); /* Zero the imaginary part */
fft_test.calc(&fft_test); /* Compute the FFT */
fft_test.mag(&fft_test); /* Obtain the magnitude square */
According to the document of the FFT library (sprc069), everything is correct, but the result is wrong.
I would greatly appreciate any help you can give me.
Thanks
I wanted to use I2C1 in F28M35X, the user guid tell me two pins can used by I2C1, that is PA0,PA1 and PG0,PG1. PA can be used by SCI1.But,I find PG can not be used. code are as follow:
void CH454_creat()
{
/* I2C1 Init */
/* Enable the peripheral */
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C1);
/* Configure the appropriate pins to be I2C instead of GPIO. */
GPIOPinConfigure(GPIO_PG0_I2C1SCL); /* GPIO00 on Concerto base board */
GPIOPinConfigure(GPIO_PG1_I2C1SDA); /* GPIO01 on Concerto base board */
GPIOPinTypeI2C(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1);
/* Initialize the I2C master. 100KHz */
I2CMasterInitExpClk(I2C1_MASTER_BASE, SysCtlClockGet(SYSTEM_CLOCK_SPEED), false);
// Enable the hardware I2C.
I2CMasterEnable(I2C1_MASTER_BASE);
// Specify slave address
I2CMasterSlaveAddrSet(I2C1_MASTER_BASE, CH454_I2C_ADDR, false);
void I2C_sent(UChar CMD)
// Place the character to be sent in the data register
I2CMasterDataPut(I2C1_MASTER_BASE, CMD);
// Initiate send of character from Master to Slave
I2CMasterControl(I2C1_MASTER_BASE, I2C_MASTER_CMD_SINGLE_SEND);
// Delay until transmission completes
while(I2CMasterBusBusy(I2C1_MASTER_BASE))
void CH454_sentCMD(UChar *CMD)
int i;
for(i = 0; i<2; i++)
I2C_sent(CMD[i]);
WHY?
I am relatively new to using the TMS320F2808 dsp based micro-controller. I am using Code Composer 5 and XDS510 JTAG debugger via USB to a windows PC to develop C code for my application. One the requirements is to have a checksum verification of the application software in FLASH (Sectors B-D) done by bootstrap software co-resident in Flash (Sector A) but different sector before launching the application image. My basic question is what is the most straight forward method to calculate & embed a 16 or 32 bit checksum into my application. I looked throughout Code Composer help to no avail, but I have to believe this is a routine task and there is a straight forward best practice to do it that I have not found yet. Some insightful feedback would earnestly be appreciated.
Thanks,
When I installed the CCSV5.3 i was connected to the usb port on my laptop (XDS100v1 to a dock station and XDS100v2 to the laptop). I Run the examples for the concerto and everything worked fine.
Now I need to connect the XDS100v2 to the dock station also, because I need to move the laptop constantly. Now it does not connect I get errors but if I go back to the laptop connects OK.
This is the error:
IcePick_C_0: Error connecting to the target: (Error -2131 @ 0x0) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.1.92.0)
My device manager indicates that the com port for the XDS100v2 changes from COM32 to COM36 when I change between Laptop and Dock, where can I change the comm port or how can I create 2 configurations?
My goal is to be able to debug the concerto in to different locations:
At WORK I use the dock station USB connections
At home I use the laptop USB connections.