Bit Angle Modulation (BAM) in a PIC


Closed Thread
Results 1 to 40 of 151

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Hmmmm, such a Radikal idea.
    Very interesting ...

    I had thought of putting the 7th bit in the middle, but it always came up lop-sided since it's Half of the period.

    But making a mirror image of the pulses (at twice the frequency) would put it smack dab in the middle of a nice symetrical waveform that might actually work.

    I must try this ...

    Oh, and Hi there Q3.
    Welcome to the forum!
    Just my musings can you do a check if duty cycle = 127 + 1 then bit 7=0 (0.005s interrupt) then 128 duty cycle. I.e cause a timer interupt delay before starting on with the BAM again.

  2. #2
    Join Date
    Nov 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by anonymouse View Post
    Just my musings can you do a check if duty cycle = 127 + 1 then bit 7=0 (0.005s interrupt) then 128 duty cycle. I.e cause a timer interupt delay before starting on with the BAM again.
    Thats as clear as mud, => 128 begin reverse read byte and vice versa

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

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

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

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,821


    Did you find this post helpful? Yes | No

    Default

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

    Very good job.

    Ioannis

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

  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

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

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