Bit Angle Modulation (BAM) in a PIC


Closed Thread
Results 1 to 40 of 151

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Thumbs up

    And I use only pure ASM code for such relatively slow MCUs, of course...

    p.s. please don't expect me to do it very soon, as i have to finish some other projects too. Firstly I must repair of girlfriend's apartment and after that I planned to develop some mechanics for other project. It could take 2 weeks, i hope. Sorry. Hope u'll be patient.
    Darrel Taylor: )))))))))))))))))))))))))))))))))))))))))))))
    It do what it supposed to do, not less not more.)) I've got enough measurement tools and other stuff to be 100% sure what i'm saying. And even i hadn't any of them... I don't just put MCU instructions into text file randomly. I know what i'm doing _exactly_, Darrel. I started studying electronics and ASM (for Z80 - first programming language i studied and used, M68K, PIC, AVR, x86 etc.) from my childrenhood, so i know what about i'm talking. U just have not any chanse, Darrel))))
    Last edited by sanch0; - 21st August 2009 at 03:16.

  2. #2
    Join Date
    Mar 2009
    Posts
    19


    Did you find this post helpful? Yes | No

    Default ok

    Quote Originally Posted by sanch0 View Post
    And I use only pure ASM code for such relatively slow MCUs, of course...

    because u can share ur code.

    so i say the secret,haha.

    we can get A[0],A[1],,,A[13].

    then

    move A[1] to W.

    then

    movff A[0], PORTA
    movwf PORTA

    then we changer the H/L in a cycle.

    have a good time.

    haha.

  3. #3
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lanyong View Post
    because u can share ur code.

    so i say the secret,haha.

    we can get A[0],A[1],,,A[13].

    then

    move A[1] to W.

    then

    movff A[0], PORTA
    movwf PORTA

    then we changer the H/L in a cycle.

    have a good time.

    haha.
    Yep=)))
    It's something like that.


    btw, i had got my first shocks from electronics when i tryed to understand how my photoflash works. There was ~1000V on capacitor after trafo, but it didn't scare me) i was 5 years old then)

  4. #4
    Join Date
    Mar 2009
    Posts
    19


    Did you find this post helpful? Yes | No

    Default photoflash

    Quote Originally Posted by sanch0 View Post
    Yep=)))
    It's something like that.


    btw, i had got my first shocks from electronics mosquitowhen i tryed to understand how my photoflash works. There was ~1000V on capacitor after trafo, but it didn't scare me) i was 5 years old then)

    but it is a secret for me.

    we can use the 1000v to electronic mosquito,

  5. #5
    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 15:45.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Thanks for the Backup Mike.
    It's nice to see somebody else gets the same numbers.

    I'm making some progress with the "full-port" modification to MIBAM.

    Actually doing the outputs is easy, just like you showed previously.
    But I'm still having problems letting the user assign pins at random.

    It's getting there, although a bit slower than anticipated.
    <br>
    DT

  7. #7
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Thanks for the Backup Mike.
    It's nice to see somebody else gets the same numbers.

    I'm making some progress with the "full-port" modification to MIBAM.

    Actually doing the outputs is easy, just like you showed previously.
    But I'm still having problems letting the user assign pins at random.

    It's getting there, although a bit slower than anticipated.
    <br>
    that's nice, but not so effective at all. interleaving could be used to get more channels at the same freq. and something else to get 100ns discretization.)))

  8. #8
    Join Date
    Mar 2009
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    from ur childrenhood.

    my god.

    too young,haha.

    i learn mcu in Unversity only.

Similar Threads

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