Droughts in AVR465 application notes

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had go through the AVR465 application notes.
i am having some droughts in this application notes.

what is (255*1023)/current gain in the AMP_LO constant?
how does the equation comes.
and in the code they used like" 255 * [(1023/2) / 8]"
i cant understand how the equation comes.

if anybody knows please explain it to me

Thanks,
Prabu.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1023 is the maximum value that can be returned by the ADC, so if your readings are greater than 1023/8 it is not safe to enable the 8x gain. The reason for the 255 is that they implement a filter of the form:

y[n] = .996*y[n-1] + .996*(x[n]-x[n-1])

and .996 = 255/256. So instead of comparing against 1023/8 they compare against 255*1023/8.

Have a look at the comments in the ADC_ISR routine. That explains the range of values they expect each quantity to be in.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks,
how to calculate the number of samples for 50 HZ and 60 HZ cycle and how the cycle length was calculated in the AVR465 application notes .
IF anyone knows, could you please explain it to me.

Thanks,
prabu