Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
        It is desired to design a module to achieve the square of a given 12 bit digital output from the adc   
0 Likes
9 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Since the output of an ADC is not a 12-bit bus but contained in two registers, you first need some mechanism to get that value into your component which is usually a job for DMA.

   

Several choices for squaring, easiest first:

   

The eoc-signal triggers your component (consisting of an interrupt and some software) to get that value and calculate the square. This will work only at lower sample-rates as some few kHz.

   

Here http://www.cypress.com/?app=forum&id=2492&rID=76712 you find some informations how to access a PSoC-internal component, a "multiply and accumulator" which could do the squaring within 18(!!!) clock cycles but is quite more complex to modify to your needs.

   

Last suggestion is to use VeriLog and program a datapath to do that job. This could do that task (shift and add) in 14 to 20 (guessed) clock cycles.

   

Get the examples, videos and appnotes for DMA

   

Get videos for component creation

   

When you decide to take "The Hard Way" using hardware (smile) look at "DataPath"

   

In the right-hand upper corner of this page is a keyword search which wil lead you to a bunch of documents and a large number of user-posts telling where you might run into troubles. (smile again)

   

So, what you've got to do first is to read a lot!

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
        What is the reason to want to do this in hardware? What do you want to do with the square later on? The ADC in the PSoC3 isn't _that_ fast, why is software not sufficient?   
0 Likes
Anonymous
Not applicable

My guess is that you want to send it out to a DAC. otherwise, you can use SW to perform the multiplication between the sampling time.

   

If the delay between the input and output is not a big issue, you can do the multpliation in SW and send it out to the DAC. Just an idea.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

So everyone does not have to keep guessing, what are you trying

   

to compute, polynomial, RMS, speed you need, even application

   

to see if another approach more direct and efficient.

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yeah, crystal balls are cheap this year, but poor performance (Broad Smile)

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 A few months ago, some company sell crystal labeled as AUSTRALIAN CRYSTAL in Hongkong as heavyly discounted AUSTRIAN CRYSTAL. 🙂

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

My friend has got a shirt with "There are no Kangaroos in Austria" on it. Seems to be the same shop.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 Kernhof Zoo in Austria had some kangaroo., not sure if they still has that.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

My crystal ball is still in repair 😞

0 Likes