Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

stange behavior

2004-10-05 by dpalu2

Hi All:

Have any of you ever come accross a bad batch of Atmel AT90S8535 
chips?
The reason I ask is as follows.

I have deployed an  application that does some "smoothing" of airflow
measurement readings with a simple equation:  
newAverage = Beta * oldAverage + (1 - Beta) * instantaneousReading
Where: 0 <= Beta <= 1 and all variables are represented as "floats"

On some devices, this works just fine.  On some, the newAverage 
reading
"blows" up (i.e., gets real big or real small) , even if I have zero
voltage on the A/D ports Same code, same hardware.  VCC looks good.   
I have all interrupts turned off.

If I just use the instantaneous readings without any smoothing, it 
never
blows up.  I've tried making variables local (stack) and global 
(heap).
Results are the same.  If its software, you'd think that I'd have the
problem on all devices, not just some of them.

The other funny thing is that the behavior is periodic.  What is 
really odd
however, is that I tried changing the equation to use all division in 
lieu
of multiplication as follows,

newAverage = oldAverage / (1 / Beta) +  instantaneousReading / (1 / 
(1 -
Beta)

Things work fine !

I am using ImageCraft ICCAVR.

It seems like some of my chips have a goofy ALU.  Has any one else
experienced anything like this?

TIA

Draper

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.