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

    Default

    Quote Originally Posted by Darrel Taylor View Post
    sanch0,

    I'm not sure what you're talking about ... but I don't think it's BAM.

    At 610hz with 13-bit resolution, the minimum bit period would be 0.2uS

    Not even an 18F running at 40Mhz could do anything with 2 instructions.
    <br>
    Maximum gained speed of modulation (whatever way u make it) is only limited by speed You can change output. Normally it's 2 instruction. But U can make it in single instruction also, just clearing the output if previous port stage is known. Of course it's only could be done in ASM. Blanking period - the only problem exist here. It will limit maximum duty cycle for some value, depending number of ports needed. I have many devices working at 610hz with 13-bit resolution. Tryed several different ways to get this. Not used MIBAM yet)

  2. #2
    Join Date
    Mar 2009
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sanch0 View Post
    Maximum gained speed of modulation (whatever way u make it) is only limited by speed You can change output. Normally it's 2 instruction. But U can make it in single instruction also, just clearing the output if previous port stage is known. Of course it's only could be done in ASM. Blanking period - the only problem exist here. It will limit maximum duty cycle for some value, depending number of ports needed. I have many devices working at 610hz with 13-bit resolution. Tryed several different ways to get this. Not used MIBAM yet)
    how to do it?

    pls post the code.

    bam is possible, we can change the H or L in two clocks in pic18. so 10M/(2^13)/2=1220.703125/2=610.3515625

  3. #3
    Join Date
    Mar 2009
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lanyong View Post
    how to do it?

    pls post the code.

    bam is possible, we can change the H or L in two clocks in pic18. so 10M/(2^13)/2=1220.703125/2=610.3515625
    i have 8 group i/o and get the 2450.98Hz 8 bit bam equl to 1 i/o:2450.98*8/(2^13/2^8)=610Hz.

    the min time is 0.2us to change the i/o's voltage

  4. #4
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    I have working code for 14bit 610hz BAM with 16 output PWM channels (code could be updated to get more channels with external logic if needed), but i didn't tried to resolve flicker problem with BAM yet. I think that simple signal mirroring doesn't help to fully avoid flicker(s), it just makes it significantly lower, but maybe also affects visual perception of signal "decreasing" actual refresh rate. And there are other ways to avoid flicker trouble, too. However, MIBAM is very good approach, thanx to it's simplicity in combination with reasonable effectivity. Thank You, Darrel Taylor & RadikalQ3 for giving good explanations and usefull thoughts. Btw, additional advantage of MIBAM method is that it might slightly reduce level of generated EMI.
    Last edited by sanch0; - 18th August 2009 at 02:03.

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


    Did you find this post helpful? Yes | No

    Default

    It's amazing how many people have come here to tell me that the Mirror Image won't fix BAM's blinking problem.

    With the mirror image, there is absolutely NO blinking AT ALL. (Not even with a video camera).

    Of course everyone admits that they've never even tried it.
    But yet they still feel it's ok to tell the world that it won't work.

    All I can do is return the favor ...
    16 channel, 14-bit BAM, at 610hz, with a PIC, is IMPOSSIBLE.

    It was bad enough when you said 13-bit. But now with 14-bits, the minimum period would be 0.1 µS. There's NO WAY you can set 16 outputs to the desired states with only one instruction, then set them all to new states on the very next instruction.

    But then ... "I've never tried it".
    <br>
    DT

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    And Christ did not ask for anything. He was crucified though...

    Ioannis

  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
    It's amazing how many people have come here to tell me that the Mirror Image won't fix BAM's blinking problem.

    With the mirror image, there is absolutely NO blinking AT ALL. (Not even with a video camera).

    Of course everyone admits that they've never even tried it.
    But yet they still feel it's ok to tell the world that it won't work.

    All I can do is return the favor ...
    16 channel, 14-bit BAM, at 610hz, with a PIC, is IMPOSSIBLE.

    It was bad enough when you said 13-bit. But now with 14-bits, the minimum period would be 0.1 µS. There's NO WAY you can set 16 outputs to the desired states with only one instruction, then set them all to new states on the very next instruction.

    But then ... "I've never tried it".
    <br>
    Sorry for my poor english, maybe u hadn't understood me as it was supposed. I don't want to flame here... i feel a bit tired myself and i'm way too lazy now to start explanation again. I had thought to upload code here, but now i'm not sure of your reaction. Maybe even then u gonna blame me). Just read my previous posts again. But i don't want to disappoint u and u a free to think that i'm lousy liar))) Actually i started to code in ASM 17 years ago. And i don't have to prove nothing here. Yes, it works. Yes i didn't tried MIBAM yet with _MY_ 14 bit _BAM_ code (which was written about half year ago). I work periodically for local advertising companies and earn some $$$ from things i develop using my older 13 bit code for 18F, which actually isn't BAM nor "clear" PWM. (which, btw could also be upgraded to 14 bit 610Hz, but don't ask me how, as i had already described it). Sorry, do not have enough strength to continue that, i feel myself wasted a bit 8] best regards....

  8. #8
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    example... sorry it's static...
    Attached Images Attached Images  

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