Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ADC noise (solved)

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Meister

Bascom Member



Joined: 27 May 2010
Posts: 314

PostPosted: Sat Nov 22, 2014 6:10 pm    Post subject: ADC noise (solved) Reply with quote

Solved! Although the periphery was disconnected from the PWM outputs,
the smoothing network was still connected resulting in power supply glitches when changing N.

Hi,
I am having a strange problem reading the ADC of Attiny841.
In the following code part I chose between increasing N via the For...Loop or setting N=100.
The ADC mode is free running.
Code:
Top:
For N = 1 To 255  
         N=100         '<----Chose remarking or not remarking this statement                      
         Ocr2a = N
         Ocr2b = N
         Waitus 50
         W = 0
         W1 = Adc
         If W1.9 = 1 Then W1 = W1 Or &HFE00
         W = W + W1
         Print #1 , W ; Chr(13);
Next
Goto Top

Remarking the line N=100 the ADC values fluctuate by about 50 LSB.
Not remarking the line N=100 the ADC fluctuates only by about 5 LSB.

Is there any idea what might cause this problem (and how to fix it)?

Regards, Meister

(BASCOM-AVR version : 2.0.7.7 )
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum