Wow Henrik...what can I say (thank heavens for folks like you & others on here)
I won't pretend to understand it all (once numbers start going above 256 values "woah, there goes scary stuff!").
re this bit...
Code:
Init:
LSW = 0
MSW = 0
AddL = 500
AddH = 2000 ' 50*256+500=768500
Not understanding the bolded bits - can you please let me know what you're doing there?
I'm trying to see how/where I would enter what in DDS terms is called the tuning word (essentially the number that gets added to the accumulator each interrupt?
Also, I was hoping (eventually) that the tuning word would arrive serially (either being calculated manually or sent from another pic)....the maths are going to be a bit troubling...to glean the tuning word to set the required output frequency, it's
required frequency/interrupt rate * accumulator size
so for a wanted frequency of 4971Hz involving a 32 bit accumulator & and say an interupt rate of 20,000Hz
(4971/20000) * 4294967296
...that's gonna be a challenge in an 8 bit PIC?
Bookmarks