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

    Duplicate label ("BAM_PIN" or redefining symbol that cannot be redefined)
    In MicroCode Sudio, View | Compile and Program Options | Compiler Tab ...

    Check the "Case sensitive" box.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Yep, thats it.

    One word describes this software.

    A M A Z I N G !

    Congratulations Darrel!

    Only leds were more linear devices...

    Thanks a lot.

    Ioannis

    P.S. About the case sensitivity, is this going to have any side effects on other programs that I develop? Why did that happen right now?

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

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

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

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

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

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

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

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