Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: V4 PWM firmware update

  1. #11
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    Here is what 2k1 posted, which is what my code is based on.
    Digital Outputs
    2 bytes per output
    [PPPPPPPS][TTTTTTMM]
    P = Value of PWM
    ([7bit Value + 1]/128)% duty cycle
    Details of full period to be determined later
    S = 1bit state
    0 = Off
    1 = on
    T = 6bits of Timer to shutoff --> [Evaluated Units in Seconds]
    If 6'bTTTTTT is 0, then shut off immediately on disconnect
    If 6'bTTTTTT is between 1 and 10 inclusive, then wait [6'bTTTTTT] seconds after disconnect
    If 6'bTTTTTT is 11, then wait 30 seconds after disconnect
    If 6'bTTTTTT is 12, then wait 60 seconds after disconnect
    If 6'bTTTTTT is 13, then wait 90 seconds after disconnect
    If 6'bTTTTTT is greater than 14, then wait ([6'bTTTTTT] * 10) seconds after disconnect
    M = 2bit Output Mode
    2'b00: Normal Full-Off or Full-On Operation Mode
    2'b01: Pulse Width Modulation Operation Mode
    2'b10: Yet to be determined
    2'b11: Yet to be determined
    The slider controls P (0-127, default is 127)
    The button control S (on or off, default to off)

    If the slider did everything, the button would be pointless. The only reason for the button is so you can leave the slider set on some value, and toggle the output from completely off to on for the PWM value.

    Obviously the first byte doesn't work as originally documented, so how does it work? You tell me how it works, and I'll fix my code accordingly.

  2. #12
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    After a little more experimentation, here is what I find:

    I tried using all 8 bits for PWM, and that didn't work right. The LED would get brighter and dimmer while slowly sliding the slider bar from one side to the other. When I just use the first 7 bits, it the LED brighness changes smoothly, as it should.

    The 'S' bit in the above byte spec confuses me. When 0, it appears the slider determines the PWM of the port. When 1, the LED is just full on, without any PWM.

    The 'MM' bits in the above spec also don't seem to do anything. It looks like the outputs are always in PWM mode, even if those bits are set to 00, meaning full on/off mode.

  3. #13
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    yup, that's right.

    that's how i understood nick to want it via conversations with him.

    when he gets back, we can tweak as neccessary.

  4. #14
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    New version of FBDemo released.

  5. #15
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    greenman, have you ever made any progress on the timers? I'd like to see the outputs shut off when data quits flowing to the FB.

  6. #16
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,028
    MDX PWM code added to first post
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  7. #17
    Low Bitrate GadgetBandit's Avatar
    Join Date
    Oct 2008
    Posts
    100
    I'm embarrassed by this display of ignorance, but I'm still at on/off for outputs. What are some real world applications for PWM?

    Thanks,
    GadgetBandit

  8. #18
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    The Simplest is to adjust the intensity of lights.

    If you're only using relays, it's not very useful.

    I'm planning to control a proportional hydraulic valve with a PWM output. The way these work is that a 50% value is neutral, and as the PWM % increases or decreases, the valve will open in that direction by an adjustable amount. It allows me to control the speed and direction of the oil flow all from one output.

  9. #19
    Low Bitrate GadgetBandit's Avatar
    Join Date
    Oct 2008
    Posts
    100
    Hobbiest servo Control?

  10. #20
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    Quote Originally Posted by GadgetBandit View Post
    Hobbiest servo Control?
    With the current firmware, no, not really.

    But it's not hard for us to add, i don't think.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. 95 Lexus SC300 - 0l33l's "Project SC300"
    By 0l33l in forum Worklogs
    Replies: 552
    Last Post: 01-14-2010, 07:55 AM
  2. Keyboard and Bluetooth Dongle Firmware Update
    By DjBac in forum Input Devices
    Replies: 1
    Last Post: 08-24-2009, 06:22 PM
  3. Centrafuse 1.45 Update
    By veetid in forum Centrafuse
    Replies: 59
    Last Post: 12-13-2007, 09:27 AM
  4. Centrafuse 1.44 Update
    By veetid in forum Centrafuse
    Replies: 22
    Last Post: 12-08-2007, 04:59 PM
  5. Centrafuse 1.42 Update
    By veetid in forum Centrafuse
    Replies: 37
    Last Post: 11-25-2007, 03:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •