- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everyone,
I stored ADC output in "uint16 adcReading". I did some mathematical operation and save it into same same variable. So my code becomes:
adcReading = ADC_GetResult16();
adcReading= adcReading*ans_0;
Now i want to pass signal stored in " adcReading" through low pass filter block. How i can do this operation?
Looking forward for your reply.
Regards
maknight
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look into the Datasheet of Filter, APIs.
There is a Filter_Write8() and a Filter_Write16() depending on your desired width.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look into the Datasheet of Filter, APIs.
There is a Filter_Write8() and a Filter_Write16() depending on your desired width.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou Bob for your reply 🙂 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Bob,
I made a project named "flip flip". I attached the zip file of it with this message.
What i want to do is as follows:
1. Digitized the input signal (VDAC in this case for test perpose).
2. Store D Flip Flop Q out put into a variable.
3. Multiply data captured from step 1 and 2 and pass through the low pass filter.
I wrote the code and every thing could please have a look on it and correct me.
Looking forward for your suggestions.
Best Regards
maknight
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You did not tell what board you use, so I presume a CY8CKIT-059 Prototyping Kit. This has got a cap buffer at P0_3 and P3_2 to stabilize the reference voltage of the ADC, I would suggest to change the settings of VREF in the ADC properties accordingly. The capacitor on P0_3 may disturb your DAC-output, have a look at the schematics (you'll find them under the programs\Cypress folder.
You do not (yet) read the data out of the filter.
Your filter sample frequency must match your ADC sample frequency
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
its CY8CKIT-050, PSOC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes settings needs to be done.
What about the Programming? Is that fine?
I am not sure about the status registers.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the -050LP kit use P3_2 there is a 10µF cap connected to.
Reading of the status-registers is ok, but you probably want to read them in the loop?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes i want to read them in loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you #include <math.h>?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perfect 🙂
Thankyou Bob 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome, Akhan!
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Bob,
I have one more problem 😞
Please guide me!
I have two channel data stored in variables (initialize in main.C) a shown below:
Channel 1 :
/*Modulation performed between ninety shifted clock signal and adc output*/
output1_zeroshifted= adc_output*zero_shiftedvalue;
/*Modulation performed between zero shifted clock signal and adc output*/
output1_ninetyshifted=adc_output*ninety_shiftedvalue;
Channel 2 :
/*Modulation performed between ninety shifted clock signal and adc output*/
output2_zeroshifted= adc_output*zero_shiftedvalue;
/*Modulation performed between zero shifted clock signal and adc output*/
output2_ninetyshifted=adc_output*ninety_shiftedvalue;
Now i want to pass each of these data through my digital filter but the problem is that, i can only use one filter block (due to psoc limit). The only way i can think of is to use a digital mux. But, then how i can write the software values into mux?
My Second idea is to write values in VDAC via DMA, i dont know if it is possible but if yes, then how i can do this?
If you have any other idea then please suggest me.
Looking forward for your sugestions.
Regards
makhan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thx for remembering me Bob 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can only send the three sequences one after the other to the filter block. Do you need the three filtered signals at the same time?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Three sequences? I didn't get it.
What i am thinking is that, We have Two channels in filter (A and B).
I want to use channel A as band pass filter and channel B as low pass filter. Output of adc will pass through Channel A (means Channel 1 and 2 will pass through BPF). So the two channels output that i shown above will be the result of multiplication stuff after band pass filter. This result i need to pass through Low pass filter (Channel B of filter).
makhan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A digital mux will not do it, you are writing directly (with CPU or DMA) data into the filter. Switching from one series of data to another will be disturbed because in the filter component some intermediate results are kept and will get mixed. So you will have to reset the filter when using another series of data (the multiplication stuff)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok Thankyou Bob for your reply.