Bit Angle Modulation (BAM) in a PIC


Closed Thread
Results 1 to 40 of 151

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    RadikalQ3,

    Thanks for the Mirror Image idea!
    It has completely removed the blinking problem.

    Unfortunately the higher frequency and extra code to reverse things has created some new ones, but I think I can work through them.

    For your first post here, it was an awesome one.

    Thanks again,

    Also, thanks anonymouse,
    But with multiple channels at different dutycycles all using the same timer, changing the interrupt sequence at 127 isn't possible.
    I hadn't mentioned the multi-channel part yet ... oops.
    DT

  2. #2
    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)

  3. #3
    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

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

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

    Very good job.

    Ioannis

  5. #5
    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 18:24.

  6. #6
    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

  7. #7
    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...

  8. #8
    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

  9. #9
    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

  10. #10
    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.

  11. #11
    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.

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