Bit Angle Modulation (BAM) in a PIC


Results 1 to 40 of 151

Threaded View

  1. #21
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    I think these Gentlemen may be having a little fun at your expense as they try to get a rise out of you (LOL). That's the only reason I can think of for avoiding a simple question and for becoming a bit offensive when challenged.

    My precalculated "output table" or "toggle table" MIBAM method should work fine with 13 or 14 bit duty cycle values but as you've already determined I can only get refresh rates of 610-Hz (8-chan, 13-bit, 200-nsec step) or 305-Hz (16-chan, 13-bit, 400-nsec step), etc., when using an 18F' device and 40-MHz clock (Tcy = 100-nsec). ISR "overhead" would be about 77% for the example below but could be improved with some structural changes.

    Take care. Kind regards, Mike


    Code:
    ;
    ;  8-chan (port b), 13-bit, 200-nsec (1638.4-usec period), 610-Hz
    ;
    v_isr_h
            movff   bdat+12,LATB    ; b12 data        (2048T)
            inDlyCy(2048*tStep-2)   ; half 2^12
            movff   bdat+11,LATB    ; b11 data        (1024T)
            inDlyCy(1024*tStep-2)   ; half 2^11
            movff   bdat+10,LATB    ; b10 data        (512T)
            inDlyCy(512*tStep-2)    ; half 2^10
            movff   bdat+09,LATB    ; b9 data         (256T)
            inDlyCy(256*tStep-2)    ; half 2^9
            movff   bdat+08,LATB    ; b8 data         (128T)
            inDlyCy(128*tStep-2)    ; half 2^8
            movff   bdat+07,LATB    ; b7 data         (64T)
            inDlyCy(64*tStep-2)     ; half 2^7
            movff   bdat+06,LATB    ; b6 data         (32T)
            inDlyCy(32*tStep-2)     ; half 2^6
            movff   bdat+05,LATB    ; b5 data         (16T)
            inDlyCy(16*tStep-2)     ; half 2^5
            movff   bdat+04,LATB    ; b4 data         (8T)
            inDlyCy(8*tStep-2)      ; half 2^4
            movff   bdat+03,LATB    ; b3 data         (4T)
            inDlyCy(4*tStep-2)      ; half 2^3
            movff   bdat+02,LATB    ; b2 data         (2T)
            inDlyCy(2*tStep-2)      ; half 2^2
            movff   bdat+01,LATB    ; b1 data         (1T)
            inDlyCy(1*tStep-2)      ; half 2^1 (0 delay)
            movff   bdat+00,LATB    ; b0 data         (1T)
            inDlyCy(1*tStep-2)      ; full 2^0 (0 delay)
            movff   bdat+01,LATB    ; b1 data         (1T)
            inDlyCy(1*tStep-2)      ; half 2^1 (0 delay)
            movff   bdat+02,LATB    ; b2 data         (2T)
            inDlyCy(2*tStep-2)      ; half 2^2
            movff   bdat+03,LATB    ; b3 data         (4T)
            inDlyCy(4*tStep-2)      ; half 2^3
            movff   bdat+04,LATB    ; b4 data         (8T)
            inDlyCy(8*tStep-2)      ; half 2^4
            movff   bdat+05,LATB    ; b5 data         (16T)
            inDlyCy(16*tStep-2)     ; half 2^5
            movff   bdat+06,LATB    ; b6 data         (32T)
            inDlyCy(32*tStep-2)     ; half 2^6
            movff   bdat+07,LATB    ; b7 data         (64T)
            inDlyCy(64*tStep-2)     ; half 2^7
            movff   bdat+08,LATB    ; b8 data         (128T)
            inDlyCy(128*tStep-2)    ; half 2^8
            movff   bdat+09,LATB    ; b9 data         (256T)
            inDlyCy(256*tStep-2)    ; half 2^9
            movff   bdat+10,LATB    ; b10 data        (512T)
            inDlyCy(512*tStep-2)    ; half 2^10
            movff   bdat+11,LATB    ; b11 data        (1024T)
            inDlyCy(1024*tStep-802) ; half 2^11
            rcall   prep            ; rebuild bdat array
            movff   btmp,LATB       ; b12 data        (2048T)
            retfie  FAST            ;
    ;
    Last edited by Mike, K8LH; - 22nd August 2009 at 16:45.

Similar Threads

  1. decoding quadrature encoders
    By ice in forum mel PIC BASIC Pro
    Replies: 93
    Last Post: - 28th February 2017, 10:02
  2. Cordic trig assembly code for PIC18f
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 54
    Last Post: - 8th September 2015, 06:36
  3. AT/PS2 Keybord - PIC Interface?
    By Kamikaze47 in forum Code Examples
    Replies: 73
    Last Post: - 9th August 2009, 17:10
  4. MIBAM - (Mirror Imaged Bit Angle Modulation)
    By Darrel Taylor in forum Code Examples
    Replies: 2
    Last Post: - 15th February 2009, 17:02
  5. Bit Angle Modulation
    By BH_epuk in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th November 2008, 08:01

Members who have read this thread : 2

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