Bit Angle Modulation (BAM) in a PIC


Closed Thread
Results 1 to 40 of 151

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    3


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Darrel Taylor View Post
    RadikalQ3,
    Thanks for the Mirror Image idea!
    It has completely removed the blinking problem.
    Oh, it's nothing... just was an idea.
    I have spent the last days reading all I found in internet about PWM, BAM, Frecuency Modulation, etc.
    I have a project to do and I am gathering all the information about this topic.
    Simply... I found your topic (and this forum) and I thought that was a nice challenge solve your blinking problem O
    I am waiting the recepcion of some hardware and in a few days I can do test with this for my own.

    Later, I realized that this is a forum on basic! (and I just use assembler)

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


    Did you find this post helpful? Yes | No

    Default

    Videos of oscilloscopes never seem to work very well.
    But it's interesting to watch the way the mirror image works.

    Let's call it BAM-BAM.

    <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/4eZho2fN3r8&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4eZho2fN3r8&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

    It's going through a ramp from 0-255 and back down.
    DT

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel. It looks very good! Congratulations on that!

    Very good job.

    Ioannis

  4. #4
    Join Date
    Nov 2004
    Posts
    61


    Did you find this post helpful? Yes | No

    Default

    I'd run in to the exact same issues between 127 and 128. Never had time to investigate it further.

    My implementation just used a state machine in the interrupt routine - 1 state for each bit.

    Each state sets TMR1 to a different level, then sets / clears the appropriate pins.

    I assume that you're implementing the 2xF 'mirror' method in a similar way? Very clever.
    Last edited by JEC; - 19th January 2009 at 17:24.

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


    Did you find this post helpful? Yes | No

    Default

    Hi Ioannis

    Hi John,
    &nbsp; Just yesterday I was thinking about how this might be good for your Christmas Lights.
    &nbsp; Apparently, the thought had not escaped you.

    Quote Originally Posted by JEC View Post
    I assume that you're implementing the 2xF 'mirror' method in a similar way?
    Well, the best method, is still to be determined. I'm trying every way I can think of ...

    Currently, I'm rotating the DutyCycle out to the Pin, and when rotating it left, I shift the timer value Right to give 1/2 the period for the next bit, when rotating right, the timerval gets shifted left for 2x the period.

    I'm also trying to incorporate the "Cylon Scanner" that Bruce and I were playing with last year.
    With the mirror image, the bit's are scanned back and forth much like a Cylon (or Kitt the car).

    Never thought that optimization exercise would actually be useful some day.
    <br>
    DT

  6. #6
    Join Date
    Nov 2004
    Posts
    61


    Did you find this post helpful? Yes | No

    Default

    &nbsp; Just yesterday I was thinking about how this might be good for your Christmas Lights.
    &nbsp; Apparently, the thought had not escaped you.
    Pity the 10F doesn't have a TMR1...

  7. #7
    Join Date
    Jan 2009
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Let's call it BAM-BAM.
    Better... BAM-MAB

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by RadikalQ3 View Post
    Better... BAM-MAB
    I had thought of that ... but it was too hard to say (unless you're drunk).
    Besides, I thought maybe Pebbles would show up to see what BamBam was doing.

    Progress is cranking.
    Should have an update soon.
    <br>
    DT

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Should be BAMAB... unless your program stick too much on a side of the PWM cycle ;o)
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    I played with BAM some time ago, but always found this step in the middle of the range to be its big issue. Thank you for a workable solution !!!

    Its interesting that Artistic License (the inventor, or populariser of BAM) make no mention of this issue.

    Bill.

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


    Did you find this post helpful? Yes | No

    Default

    Its interesting that Artistic License (the inventor, or populariser of BAM) make no mention of this issue.
    I think Artistic License had given up on it, since all mention of BAM has been removed from their website. And when I was searching the web for answers, all I found was lots of threads with people complaining of blinking problems.

    BAM-BAM to the rescue!
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3147&stc=1&d=123283468 8" /> <!-- Name:  bambam.jpg
Views: 49958
Size:  4.3 KB -->

    I now have working code.
    Anyone want to beta test it before I make it public?

    It can run up to 48 LEDs simultaniously. (48mhz OSC)
    Or 1 LED per mhz. 4mhz=4 LEDs, 20mhz=20 LEDs.
    It has a self-contained Interrupt system. Instant Interrupts not required.
    <br>
    DT

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 : 3

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