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

    Quote Originally Posted by Ioannis
    One word describes this software.
    <script language="JavaScript" src="http://www.pbpgroup.com/js/ColorText.js"></script>
    <div id="DTtext"><b>A M A Z I N G !</b></div>
    <script>ColorText("DTtext",['red','green','blue','magenta','cyan','black']);</script>
    Thanks Ioannis, and I ... uh ... may have embellished your quote a little. (Shameless )

    P.S. About the case sensitivity, is this going to have any side effects on other programs that I develop?
    I guess that depends on how much ASM code you've been writing.

    The default for MPASM is "Case Sensitive".
    The default for MicroCode Studio is "Case Sensitive".
    So somewhere along the way, you've changed the setting in MCS, and it may or may not have solved your problem at the time. Sometimes you just try things ... grasping for answers.

    Why did that happen right now?
    Because I chose to use tricky things that require case sensitivity.

    The sensitivity option has no effect on PBP statements, since PBP isn't case sensitive to begin with.
    And there are some ASM problems that can come up when un-checking the "Case sensitive" box, so I'd recommend leaving it checked at all times.
    DT

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


    Did you find this post helpful? Yes | No

    Default

    OK. Thanks for the explanation. I will keep the option checked for case sensitivity. I really cannot recall un-checking it...

    About the Light intensity control, at least for small 5mm Leds, at low levels there is a problem because of the nature of the diodes. Of course it has nothing to do with the code you have developed.

    I suppose that there should be a non-linear function to increse the current at low levels, maybe an exponential or geometric function. Some experimentation will be necessary.

    Anyway, having 20 devices to control with a kind of PWM is fantastic.

    Once again, you are #1!

    Ioannis

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Very smooth fading effect. Nice job DT.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Thank you Bruce!

    And thanks for the Cylon Scanner.

    I mentioned it earlier, and I did end up using the Cylon program we were playing with a while back.

    To get the Mirror Image, it scans back and forth just like we had it. Then it uses that to mask the current bit in the dutycycles. It really knocked the code size down.

    I used your Cylon version, of course.
    <br>
    DT

  5. #5
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default

    Ioannis:

    You might want to remap the LED's brightness curve to compensate for the non-linearity in perceived brightness.

    This are the values I use
    Code:
    data @$0, $00,$00,$01,$01,$01,$01,$02,$02,$02,$03,$03,$03,$04,$04,$04,$04,$05,$05,$05,$06,$06,$06,$07,$07,$07,$08,$08,$08,$09,$09,$0A,$0A
    data      $0A,$0B,$0B,$0B,$0C,$0C,$0C,$0D,$0D,$0E,$0E,$0E,$0F,$0F,$10,$10,$10,$11,$11,$12,$12,$13,$13,$13,$14,$14,$15,$15,$16,$16,$16,$17
    data      $17,$18,$18,$19,$19,$1A,$1A,$1B,$1B,$1C,$1C,$1D,$1D,$1E,$1E,$1F,$1F,$20,$20,$21,$21,$22,$23,$23,$24,$24,$25,$25,$26,$27,$27,$28
    data      $28,$29,$2A,$2A,$2B,$2B,$2C,$2D,$2D,$2E,$2F,$2F,$30,$31,$31,$32,$33,$33,$34,$35,$35,$36,$37,$37,$38,$39,$3A,$3A,$3B,$3C,$3D,$3D
    data      $3E,$3F,$40,$40,$41,$42,$43,$44,$44,$45,$46,$47,$48,$49,$49,$4A,$4B,$4C,$4D,$4E,$4F,$50,$51,$51,$52,$53,$54,$55,$56,$57,$58,$59
    data      $5A,$5B,$5C,$5D,$5E,$5F,$60,$61,$62,$63,$64,$65,$67,$68,$69,$6A,$6B,$6C,$6D,$6E,$6F,$71,$72,$73,$74,$75,$77,$78,$79,$7A,$7B,$7D
    data      $7E,$7F,$81,$82,$83,$84,$86,$87,$89,$8A,$8B,$8D,$8E,$8F,$91,$92,$94,$95,$97,$98,$9A,$9B,$9D,$9E,$A0,$A1,$A3,$A4,$A6,$A7,$A9,$AB
    data      $AC,$AE,$B0,$B1,$B3,$B5,$B6,$B8,$BA,$BB,$BD,$BF,$C1,$C3,$C4,$C6,$C8,$CA,$CC,$CE,$D0,$D1,$D3,$D5,$D7,$D9,$DB,$DD,$DF,$E1,$E3,$E6
    Then just
    Code:
    READ LED, LED

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


    Did you find this post helpful? Yes | No

    Default

    Hi gmglickman,

    Hmm, nice, thanks for the post. I was thinking more complicated on this!

    Ioannis

  7. #7
    Caius1's Avatar
    Caius1 Guest


    Did you find this post helpful? Yes | No

    Default Regarding blink

    Hi,

    I came across this topic when browsing for BAM.

    Regarding the blink can you verify that the blink still occurs when:
    1 The last value of the period = 2^nBits - 2 instead of 2^nBits-1
    2 New value is only updated at the start of a pwm period.

    It would seem strange to me if it does.
    I think that a blink can only occur form value=0 to value=x

    Thanks

  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 Caius1 View Post
    Regarding the blink can you verify that the blink still occurs when:
    1 The last value of the period = 2^nBits - 2 instead of 2^nBits-1
    2 New value is only updated at the start of a pwm period.
    I assume you mean reversing the order of bits 6 and 7.

    Yes, the blink still occurs. It just happens at different numbers.
    No matter which way you order the bit's, if they are only scanned in one direction, there will always be a blink at some point.

    I also found that at other points in the dutycycle, the original BAM has several more less obvious blinks as the phase shift does the exact same thing in the lower bits. You just can't see them as well because they are shorter periods. But if you stare right at the LED straight on, you can definitely see them.

    However, the symmetrical nature of the Mirror Imaged waveform, completely eliminates ALL of the blinking. It's really amazing how well it fixed the problems.

    You can see how it works from the animation in this thread ...

    MIBAM - (Mirror Imaged Bit Angle Modulation)
    http://www.picbasic.co.uk/forum/showthread.php?t=10564
    DT

  9. #9
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    6


    Did you find this post helpful? Yes | No

    Exclamation Cylon Scanner Error message

    Hi Darrel.

    I am testing your Cylon Scanner
    code on a 887 chip at 8MHz.

    I am stuck on this error:

    Error[118] c:\pbp\mibam-~1.asm 97:Overwriting previous address contents (2007)

    In fact, the code is a copy of the example. Nothing more or less. Of course the part about wsave is included too. Attached is the final test code.

    Regards,
    Konrad
    MIBAM_Cylon.pbp.txt

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