- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to implement application note AN66444 in my project that require an accurate voltmeter.
Following is the code segment from main.c downloaded with AN66444:-
{ ...................
/*perform CDS*/
iVcds = iVout1 - iVout2;
/* IIR Filter*/
iVcds_curr = iVcds;
iVcds_acc += (iVcds_curr - iVcds_acc) >> 4;
}
/*Display output in desired format on UART*/
fVcds = ADC_DelSig_1_CountsTo_Volts(iVout1);
UART_1_PutChar('\r');
UART_1_PutChar('\n');
sprintf(caVcds_decimal_str,"%f",(float)fVcds);
UART_1_PutString((uint8*)caVcds_decimal_str);
The display routine is displaying "iVout1".
I could not find any link between the "IIR routine" and the "display routine".
Would greatly appreciate if someone can help me on how the IIR Filter is being used here ?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
could you please check IIR filter implementation appnote AN2099 (http://www.cypress.com/file/127091/download ). Please check the psuedo code under "PSoC 4 and PSoC 5LP Filter Implementation" for low pass implementation.
Best Regards,
VSRS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum!
Change some settings:
In system view set the heap size to 0x0200
in Project->Build settings->Arm GCC...->Linker set both "Use newlib nano" and "Use newlib nano float formatting" to true.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thank you thequick reply.
Sorry, i did not make my problem clear.
The IIR Filter code are not being utilized. I would like help on how to make use of the IIR Filter code to perform the low pass filter.
The "iVcds_acc" value does not correspond to the actual input value. I think additional code are needed to implement the filter.
I can understand the correlated double sampling (CDS) but am at a total lost on the IIR Filter portion.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project or a shortened version that shows the error 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.
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
Thank you all for the reply.
I did replace "iVout1" with "iVcds_acc" but the value is much lower that my actual input. It looks like something is missing in the "/* IIR Filter*/" code segment.
I have attached the project file, which is actually the example file from AN66444, The only change that I have made is the output code - from UART to LCD Display.
- 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
iVcds_acc += (iVcds_curr - iVcds_acc) >> 4; is giving an output = 7.573.
iVcds gives an output = 4.622 which I have verified with a multimeter to be correct.
Being bad at filter equations, I am not able to figure out what is wrong. Any tips would be most helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
could you please check IIR filter implementation appnote AN2099 (http://www.cypress.com/file/127091/download ). Please check the psuedo code under "PSoC 4 and PSoC 5LP Filter Implementation" for low pass implementation.
Best Regards,
VSRS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi VSRS,
Thank you.