concatenating 4 bytes into one pseudo 32 bit counter?


Results 1 to 12 of 12

Threaded View

  1. #9
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: concatenating 4 bytes into one pseudo 32 bit counter?

    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?

    Last edited by HankMcSpank; - 27th August 2011 at 00:45.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts