cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

Does anybody have an example of using the digital filter without DMA, under software control only? 

   

For example, ADC_SAR > Filter Channel 1 > DAC8, with code in main.c?  In other words, simplest way possible without DMA?

   

 

   

Thanks,
Rory

   


 

0 Likes
9 Replies
JoMe_264151
Expert II

It would be interesting to know why you want to cut the abilities (DMA, Ints) of the PSoC5.

   

What do you want to do with the filtered data, what is your needed/wanted conversion rate, what resolution is required?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Our timing is determined by a clock driven interrupt that sets the sample rate of the input ADC and DAC.  Output of the ADC_SAR should go directly to the filter, output of the filter goes directly to the VDAC8 channel.  

   

I guess the real question is:

Can the digital filter be used without using the DMA? If so, how? Where is an example?

   

Why? Because we wish to maintain timing of sample processing via software instead of relying on DMA. Reasons for this I cannot discuss here.

0 Likes
ETRO_SSN583
Esteemed Contributor

 The DFB Assembler would be a straightforward way of accomplishing

   

what you want. All you need are filter coefficients and topology, IIR,

   

FIR, and the coding should be pretty simple. Coefficients you can get

   

from Cypress tool, or there is a lot of freeware for designing filters.

   

 

   

http://www.cypress.com/?rID=60720

   

 

   

Food for thought, Dana.

0 Likes
Anonymous
Not applicable

Thanks Dana. We have the filter topology and coefficients figured out, the difficult part has been getting the data in and out of the filter in a way that we have full control over it.

   

I was hoping someone had already figured it out without us having to reinvent the wheel.  My DSP guy has been smashing his head against the wall over this. He's not comfortable with DMA and learning curve is too steep with the deadline we have.

What we really need is an education in DMA and how we can keep up with it in software so when data is transferred we can synchronize the filter output to our processing algorithm.
 

   

Rory

0 Likes
HeLi_263931
Honored Contributor II

There are several AppNotes regarding introduction into the DMA. Start with AN52705 (http://www.cypress.com/?rID=37793 ), if you want to go deeper look at AN84810 (http://www.cypress.com/?rID=82680 ).

   

Also, there are sample projects available for the componts (Right click, search for sample projects).

   

Last but not least: one can trigger a DMA via software, though indirectly: connect a 1-bit-control register to the DMA request input, then you can control when the DMA will happen (set it to pulse mode). A status register can be used correspondingly to read the DMA request output of the filter (use sticky mode then).

0 Likes
ETRO_SSN583
Esteemed Contributor

These might help -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=37793     AN52705     Getting Started with DMA

   

http://www.cypress.com/?rID=82680     AN84810     PSoC® 3 and PSoC 5LP Advanced DMA Topics

   

http://www.cypress.com/?rID=44335     AN61102 PSoC® 3 and PSoC 5LP - ADC Data Buffering Using DMA

   

 

   

    

   

 

   

          

   

http://video.cypress.com/video-library/search/dma/     Videos on DMA

   

 

   

 

   

Don't forget there is a DMA wizard that aids in setting up DMA in Creator, in the tools menu.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Esteemed Contributor

And these -

   

 

   

    

   

          

   

https://www.youtube.com/results?search_query=dma+psoc Videos on DMA (some overlap)

   

   

 

   

Regards, Dana

0 Likes
Anonymous
Not applicable

As a followup to the original question, we did manage to poll the digital filter without using the DMA. 

The functions are there in the API,

Filter_Start(), Filter_Write16(), Filter_Read16()

   

Filter_INT_CTRL_REG |= 0b11 to enable interrupt flags on filters when the filter has output data. We watched the status of the filter by polling its status register using Filter_IsInterruptChannelA() and Filter_IsINterruptChannelB(), used Filter_ClearInterruptSource() to clear the status bits, then used FIlter_Read16().

Keep in mind that the filter output is signed integer and the DAC8 is unsigned uint8, so conversion from 2's complement needs to be done before writing it to the DAC8.

 

0 Likes
HeLi_263931
Honored Contributor II

Silly me 😞 I was looking at the data sheet before my answer, and completely missed that (and I was even looking for something like that).

0 Likes