Per,
yes, the boxcar integrator works. But rather than making use of tricks to speed up the program, it is based on using the Xmega with its Event and DMA capabilities and its high clock frequency (it runs at 48MHz)
- oh yes, but there is a trick: MWS in the German forum wrote a function that sums one array onto another one, element for element
[url]http://bascom-forum.de/showthread.php?3322-Beispiel-custom-mem-byte-copy-in-Assembler[/url]
If you would have to do the summation for some thousands of elements by a for loop you would be lost..
Useful also in this respect are some array functions provided by Galahat (Summing a partial array):
[url]http://bascom-forum.de/showthread.php?5596-Summe-eines-Array-Teils-bilden/page2[/url]
Also, it would be nice if Mark could pretty up the Max and Min functions by adding a parameter for the number of elements to search through.
Galahat provided assembler code earlier:
[url]http://bascom-forum.de/showthread.php?5250-Zweierkomplement&highlight=Get_min_sint_16[/url]
These are a collection of array functions potentially useful to somebody, and maybe someone could put 'em into a library (I never did so).
Best regards, Meister
↧
Share your working BASCOM-AVR code here : Moving average for INTEGER and SINGLE data streams : REPLY
↧