# 2D FFT in MPC5775K

cancel
Showing results for
Search instead for
Did you mean:

## 2D FFT in MPC5775K

1,680 Views
Contributor II

I have some questions in writing  2D FFT code in MPC5775k by  using its SPT

1)  Use WIN instruction, failed.

// Transfer input vector by PDMA
// 128 x 64-bit real numbers(32bit real,32 bit image), 64-bit PDMA SRAM word holds 2 input points
// Sign Extension,direct, 24 bit complex pack
// VECTOR_LEN = 128 (128 x 2 input points in each), 128 = 0x0080
// SRAM(input_addr) -> OPRAM (0x8000)
0xA1040080, 0xDEADDEAD, 0x80000000, 0x01000001,    // test ,move data from SRAM to SPT OPRAM, ok

// FFT 128 RDX4 instruction w/ complex input
//  WIN instruction, multiply a constant complex, here is 2 + 0i;
0x86000080, 0x80009000, 0x00000101, 0x00020000,    // WIN failed here

// Stop Cmd
0x10000000, 0x00000000, 0x00000000, 0x00000000,

what I  want to do is all the data  x 2,but failed, why?

2)  SPT is fixed point, when I do 2D FFT, the input data is comlex, and its range is  -2^23 to +2^23,

Is SPT capable of doing such FFT?   I use the real FFT examples provided by NXP FAE, it supports

input data range is 0 ~ 4096(with left shift, unsigned int)

I have implemented real FFT128/256/512/1024, supported  input data range is 0 ~ 4096, but get stuck in complex FFT when input data is very large.

3)  Where to find complex FFT example for MPC5775K in this forum?

Any help will be very appreciated..

Labels (1)
• ### General

12 Replies
414 Views
Contributor II

Dear Kovar,

I just have emailed FAE Jason, he said it's still a pending problem.  for the first round FFT,if  input data is larger than 16bits,  e.g., input FFT data is  24bits Re + 24 bits Im,  the overflow is most likely to happen.

if you have  SPT complex FFT example with input data as 24bits Re + 24 bits Im,pls send me for reference, this issue puzzled me for weeks.  many thanks.

414 Views
NXP Employee

Hi,

unfortunately, we do not have any example code for SPT module. Please be patient, Jason Yang will write you back as soon as he have an answer from application team.

Regards,

Martin

414 Views
Contributor II

You are so kind.  What  I am  worried is that  the original designer of MPC5775K may omit that some applications' requirements to perform complex FFT with large input data, and just considered data from ADC(16-bit width data  is enough, yes, SPT is capable of perform FFT with 16bits data,very fast).  if the IC designer of MPC5775K did take the needs into account,  it just take some time to solve this problem.

The final official datasheet of MPC5775K is not available on NXP website yet, I have a preliminary one, not much detaied information about SPT  given in it.

414 Views
Contributor IV

Hi,

I'm working with the MPC5775K now. And I also had some problems in debugging the SPT module. I had a problem that the initialization failed. When I finished the initialization. It was always waiting for the STOP mode.  Like the picture shows,

Do you have the same problem? And have you solved it?

Regards,

Ron

414 Views
Contributor III

Hi，

Have you solved the problem? I use ‘aligned (8)’，but it  was also always waiting for the STOP mode.Could you give me some suggestions?

Regards,

EVA

414 Views
Contributor II

The aligned is needed in not only the command address,but also the source_addr(eg SYSRAM_MEM_START_ADDR).Please look at the variables address which is used to be the source or destination address.

Regards

Hai

414 Views
Contributor II

Yes,  I  took weeks to solved  this problem.  I know well the your problem you have encourtered.

This is bug of  NXP SPT FFT example code.  From datasheet of MPC5775k, We know the command address of SPT should be multiple of 8,  the code you post here has not guaranteed this rule, because  the compiler allocate  command_list_init[] randomly. To guarantee  address of command_list_init[0] is multiple of 8, you can take following steps;

1)  in ld file, allocate a buffer for SPT, e.g., my code here

.sptytx1 : ALIGN(8)

{

*(.sptytx1)

} > m_data AT>m_text

2) use a global array to replace local command buffer . declare  it like this :

static uint32_t RFFT128_command_list_Init_Align8[20]  __attribute__ ((section(".sptytx1"))) = {0};

3) in your code, use  RFFT128_command_list_Init_Align8[20] to replace  command_list_init[]

for(i = 0; i < 20; i++)

{

RFFT128_command_list_Init_Align8[i] =  command_list_init[i];     // copy local variable to global array,which is multiple of 8

}

SPT.CS_PG_ST_ADDR.R = (uint32_t) &RFFT128_command_list_Init_Align8;

following this way, I have implemented real FFT 128/256/512/1024, the resutls are okay.

Regards.

Yang Tianxi

China.

414 Views
Contributor III

Can I communicate with you, I was having difficulty doing the 64-point 2DFFT

414 Views
Contributor I

Hello,

I am experiencing the same problem, got a proper alignment of 8 of the script to be run location, but after lunching it stays in RUN state forever, I have reduced my script just to sopy data and later just to STOP instruction with no result.

Attached screenshot:

Script location is 0x4012E810, so divisible by 8. (fixed with alignment attribute)

Are there any other constrains?

Clock is supplied to SPT module correctly

Regards

Krzysztof

414 Views
NXP Employee

Hi,

this issue is already solved with FAE Jason Yang and automotive experts team.

Regards,

Martin

414 Views
Contributor IV

Hi,

I had some problems in the FFT module too. Could you please tell me how to contact the FAE ?

Regards,

Ron

414 Views
NXP Employee

Hi Ron,

FAE is professional service which you have to buy. Please look at the following URL, where you find the prices of the service.

Regards,

Martin