- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
New to the forums, just started using PSoC and the board that I have. Currently working an small project, as we are supposed to use an on board potentiometer to adjust an on board LED brightness. We are also supposed to report the 16 bit value to the LCD character display. I have managed to perform both of these steps, however there appears to be some sort of noise, as my least significant digit fluctuates.
Source Code:
int main()
{
LCD_Char_Start();
PWM_1_Start();
ADC1_Start();
Clock_1_Start();
uint16 ADC_Val;
char buffer[5];
for(;;){
ADC_Val=ADC1_Read16();
PWM_1_WriteCompare(ADC_Val/65);
sprintf(buffer,"%04x",ADC_Val);
LCD_Char_Position(0u, 0u);
LCD_Char_PrintString(buffer);
}
}
Any suggestions?
Thanks in advance.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are running at 16 bit resolution, and a Vref of Vdd then each
lsb is ~ 76 uV. Use a DSO, look at Vdd, set it to infinite persistence,
and you will probably see ~ 200 mV to 400 mV of noise. Translate
that to lsbs =~ 2800 lsbs of noise.
So bypassing is critical, see references below. Use Polymer Tants
as they are ~ 10 x better f vs Z performance.
Also plan on A/D pin input not next physically to pins switching a lot
of digital I/O.
http://www.cypress.com/?rID=39677 AN57821 - PSoC® 3, PSoC 4, and PSoC 5LP Mixed Signal Circuit Board Layout Considerations
http://www.cypress.com/?rID=40247 AN58827 - PSoC® 3 and PSoC 5LP Internal Analog Routing Considerations
http://www.cypress.com/?rID=39974 AN58304 - PSoC® 3 and PSoC 5LP – Pin Selection for Analog Designs
Another thing you can do is averaging N samples, for uncorrelated noise you can
get significant "filtering" from this, acts as a LPF.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are some additional ap notes on noise and errors that may be useful -
www.dropbox.com/s/ruaf9booe17jk8n/PCB%20Layout.zip
Regards, Dana.