cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1

kep_284046
New Contributor II

 Hi everyone,

   

ADC -> DMA -> DFB( A^2+(A+1)^2+(A+2)^2+......+(A+n)^2= sqrt(X) ) -> DMA -> Variable

   

Do you have to make examples, please? I could not somehow.

0 Likes
12 Replies
Bob_Marlowe
Expert II

Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

Did you already read this document and this one for advanced techniques



Bob
 

0 Likes
kep_284046
New Contributor II

Hi Bob,

   

I did DMA settings. In fact, i did calculations with interrupt without the DFB.

   

But I can not do some of the DFB code and settings of the DFB.

0 Likes
Bob_Marlowe
Expert II

What is the reason you use the DFB component which you have to program separately and not the Filter-component?

   

 

   

Bob

0 Likes
kep_284046
New Contributor II

 Hi Bob,

   

My goal is not to filter. I want to use as a calculator DFB. The main loop cannot correctly run the other transactions because the time is not enough. 

   

(i am so sorry. I had use google translate for translation because my bad english. :))) 

0 Likes
Bob_Marlowe
Expert II

The DFB has to be programmed with the DFB-assembler which really is not easy to handle.

   

Manipulating data might be done better/faster (as long as integer arithmetic is used) using UDBs and datapath objects. You have got 24 of them within your PSoC5. Each contains some PLD, registers, a programmable ALU, two FIFOs and a counter. These UDBs can be programmed using a hardware definition language (HDL) named Verilog which is already installed together with documentation on your system.

   

 

   

Bob

0 Likes
kep_284046
New Contributor II

Can you write DFB assembly sample program, that can multiply? Please, I was so confused.

0 Likes
Bob_Marlowe
Expert II

DFB assembly is

   

1st quite complex

   

2nd has a geometry adapted to the need of digital signal filtering

   

So, what exactly is the calculation you have to make and how much time have you got. Can you post your complete project as an example, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

Another approach could be to write some asm statements using the CPU's multiply instructions directly

   

 

   

Bob

0 Likes
kep_284046
New Contributor II

Hi Bob,

   

I gave I sent in earlier posts. I sent the above 2. post. I want to do the actual RMS calculation. I am a repeat calculations (RMS) every 10 ms for 200 sample. but the cpu calculate another jobs.

   

i want to do with DFB for learn and develop. I couldn't do it with DFB. I decided to start from the beginning to the DFB is complex. I begin with an example that can only multiply. so i want simply example.

   

Thank you very much for your interest.

0 Likes
odissey1
Honored Contributor II

kenan_re,

   

there is multiply and accumulate component which utilizes DFB block, and does exactly what are you looking for:

   

http://www.cypress.com/forum/psoc-community-components/multiply-and-accumulate-access-macc-dfb-easy-...

0 Likes
kep_284046
New Contributor II

That post, i tried multiply and accumulate component.
i multiplied 0.3 x 0.3 but the result wasn't true.

0 Likes
odissey1
Honored Contributor II

kenan_re,

   

MACC works fine, you must correctly convert your values to Q-numbers and back. There are several posts discussing "incorrect" output from MACC, please check this thread for example:

   

http://www.cypress.com/forum/psoc-5-device-programming/signed-multiplication

0 Likes
kep_284046
New Contributor II

Odissey1,

   

I tried the post and  it doesn't show value one byte. I am using max value 0xFFFF and This value insignificant for Q23.

   

For example: 0x0000099A * 0x0000099A= 0x000000 5C30A4 --> so lower values are lost

   

​I want to make the most of 16-bit multiplication makes the DFB for this reason.

0 Likes