Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Fusion Brain v6 Protocol Documentation?

  1. #1
    FLAC
    Join Date
    Jan 2008
    Location
    Dartmouth, MA
    Posts
    916

    Fusion Brain v6 Protocol Documentation?

    I'm working on writing software to control the FBV6 from linux, or windows for that matter. Whatever work I do here, I also intend to shoot over to Sonic so he can get his Centrafuse plugin working with the FBv6 while sticking to .net 3.5

    Before trying too hard to reverse engineer things, I figured I'd just ask about the protocol. If this information has already been given out, just please direct me there as I couldn't find it searching.

    1. Which USB endpoints do you talk to?
    2. How do you send the data? Bulk? Interrupt?
    3. How big is the data packet?
    4. Asking for input X, how would I read its value from the data packet?
    5. Setting output X, how would I set its value in the data packet?

    The answers for FBV4 would be:
    1. Read endpoint 1, Write endpoint 1
    2. Bulk
    3. 64 bytes
    4.
    Code:
    // assume data is the byte array returned from the brain
    int offset = x * 2 + 32;
    byte low = data[offset];
    byte high = data[offset+1]
    int value = low * 256 + high
    5.
    Code:
    //On: 
    data[x*2] = 1;
    //Off
    data[x*2] = 0;
    And to save you work, I don't mind digging through code in any language for my answers if the source is available somewhere.


    Thanks!
    My Nearly Complete Car:
    http://www.mp3car.com/vbulletin/show...ed-car-pc.html

    Micro Control Center... Control Your Car Across the Internet
    http://www.mp3car.com/fusion-brain/1...-internet.html

    Website: (It's a work in progress, really. All my projects have taken me from ever really developing it.)
    http://paulfurtado.com/

  2. #2
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    1) 1, and 2 mostly. 3 is available but reserved. There is also a 4th endpoint using CDC emulation.
    2) All bulk, except CDC
    3) 64bytes, however it will accept packets 1024 in size. If you read 1024 from endpoint 2 (analogue inputs) you will get 16 sequential readings returned faster than if you read 64bytes 16 times. That is a USB quirk.
    4) Endpoint 2
    Code:
                    byte[] _allDigitalOutputReadStates = new byte[64];
                    byte[] _allAnalogues = new byte[64];
                    MainUSBClass.allFusionBrains[0].ReadDataFromFusionBrain(ref _allDigitalOutputReadStates, 0x01); // Returns what the current states are in the same format as the output format. Good for verification
                    MainUSBClass.allFusionBrains[0].ReadDataFromFusionBrain(ref _allAnalogues, 0x02);
    
                    List<double> aValues = new List<double>();
                    for(int a = 0; a < 15*2; a+=2)
                    {
                        int aValue_INT = ((_allAnalogues[a] & 0x03) << 8) + _allAnalogues[a + 1];
                        aValues.Add(3.3 * ((double)aValue_INT) / 1023.0);
                    }
    5) Endpoint 1. 64 byte length, but any number of bytes can be transfered (more or less than 64)
    The snippet below is from my testing program which runs 8 outputs ON in a sequence. So 0-7 on all the rest off. Then 1-8 on all the rest off. Then 2-9 on all the rest off and so on.
    Code:
                    int _code = 0x01; // 0x01: All off except..., 0x02: All on except..., 0x03: Normal
                    int _length = 8;
                    _toSendArray = new byte[1 + (_length * 2)];
                    _toSendArray[0] = (byte)((_code << 5) + _length);
                    for (int l = 0; l < _length; l++)
                    {
                        _toSendArray[(l * 2) + 1] = (byte) ((port_i + l) << 3); // which port
                        _toSendArray[(l * 2) + 2] = 0xFF; // what value
                    }
                    port_i++;
                    MainUSBClass.allFusionBrains[0].SendDataToFusionBrain(_toSendArray, 0x01);
    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

  3. #3
    FLAC
    Join Date
    Jan 2008
    Location
    Dartmouth, MA
    Posts
    916
    Awesome thanks for the quick response! I've got it turning outputs on/off and reading the state of the outputs. Haven't tried reading analogs yet, but I'm sure that won't be an issue.


    Issues I noticed: If I turn all outputs on while using a 12 volt PSU (desktop computer power supply's 12 volt rail with 19A limit) after a few seconds, all the LEDs shut off and the USB connection to the brain breaks (it can be reopened sometimes).
    No relays are attached. Also, my port 17 is fried (not just LED, teted with multimeter). And also, on relay kickback, I don't think it's being entirely isolated since I see the lights dimly blink and then read/writes fail. Think this baby is fried?
    My Nearly Complete Car:
    http://www.mp3car.com/vbulletin/show...ed-car-pc.html

    Micro Control Center... Control Your Car Across the Internet
    http://www.mp3car.com/fusion-brain/1...-internet.html

    Website: (It's a work in progress, really. All my projects have taken me from ever really developing it.)
    http://paulfurtado.com/

  4. #4
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by PaulF View Post
    Awesome thanks for the quick response! I've got it turning outputs on/off and reading the state of the outputs. Haven't tried reading analogs yet, but I'm sure that won't be an issue.


    Issues I noticed: If I turn all outputs on while using a 12 volt PSU (desktop computer power supply's 12 volt rail with 19A limit) after a few seconds, all the LEDs shut off and the USB connection to the brain breaks (it can be reopened sometimes).
    No relays are attached. Also, my port 17 is fried (not just LED, teted with multimeter). And also, on relay kickback, I don't think it's being entirely isolated since I see the lights dimly blink and then read/writes fail. Think this baby is fried?
    Do you have a prototype or a final version? Quick check, look at the analogue inputs. Do you see a bunch of 0603 resistors above the ports? If you have a beta or a prototype, then you have ridiculously small current limiting resistors into the output LEDs. They will shine bright, get hot, and overload pretty much everything when on. This was a fab mistake and they put on 200ohm instead of 2kohm.

    #17 is not connected. You will note that the Fusion Brain has 30 Digital Outputs, yet 32 digital output pins. If you flip #17 over, you will see no FET on the backside. Likewise, port 20-something on the horizontal row is always on and does not count as an output either.
    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

  5. #5
    FLAC
    Join Date
    Jan 2008
    Location
    Dartmouth, MA
    Posts
    916
    Next to the analogs I have surface mount resistors that say "105" on them. Is that what you mean?
    My Nearly Complete Car:
    http://www.mp3car.com/vbulletin/show...ed-car-pc.html

    Micro Control Center... Control Your Car Across the Internet
    http://www.mp3car.com/fusion-brain/1...-internet.html

    Website: (It's a work in progress, really. All my projects have taken me from ever really developing it.)
    http://paulfurtado.com/

  6. #6
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by PaulF View Post
    Next to the analogs I have surface mount resistors that say "105" on them. Is that what you mean?
    Yup. You have a final version then. There is something else going on then. I have powered them all on with just the USB connection (500mA @ 5v for powering everything).

    So 80mA at 5v and 192mA at 12v dissipated through the LEDs.

    Also, it uses the 5v USB power as a redundant backup. If the 12v droops or dies, the 5v from USB automatically takes over. It would take a drooping of the 12v and a current load of more than 500mA on the USB port to get it to reset. Is it getting hot or anything else? There is a 500mA thermal fuse on there. It will not power itself over USB until it cools back down if the current limit was tripped.
    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. #7
    FLAC
    Join Date
    Jan 2008
    Location
    Dartmouth, MA
    Posts
    916
    I can turn them all on when I'm powering by USB, but not when powering by 12 volts.

    Does relay kickback usually dimly blink all LEDs on the brain AND make it reset or potentially require a disconnect/reconnect? This is my red flag.


    It does get fairly warm, but nothing too crazy. With 12.06 volts in, when all outputs are on, the pins read in the low 11 volts with nothing attached (I'm in class now and don't remember the exact reading I got earlier.) With USB in and all outputs on, outputs read in the 2-3 volt range.
    My Nearly Complete Car:
    http://www.mp3car.com/vbulletin/show...ed-car-pc.html

    Micro Control Center... Control Your Car Across the Internet
    http://www.mp3car.com/fusion-brain/1...-internet.html

    Website: (It's a work in progress, really. All my projects have taken me from ever really developing it.)
    http://paulfurtado.com/

  8. #8
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by PaulF View Post
    I can turn them all on when I'm powering by USB, but not when powering by 12 volts.
    Strange indeed...

    Does relay kickback usually dimly blink all LEDs on the brain AND make it reset or potentially require a disconnect/reconnect? This is my red flag.
    I've not ever had that happen. What relays are you using?

    It does get fairly warm, but nothing too crazy. With 12.06 volts in, when all outputs are on, the pins read in the low 11 volts with nothing attached (I'm in class now and don't remember the exact reading I got earlier.) With USB in and all outputs on, outputs read in the 2-3 volt range.
    You are reading leakage current through the NPN's which happen to be 11ish or 2-3ish volts. The actual current is less than a milliamp. They are really floating with leakage, otherwise pulled down. If you mean the + side of the outputs then it will read Vin-0.6-0.8v (diode drop).
    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

  9. #9
    FLAC
    Join Date
    Jan 2008
    Location
    Dartmouth, MA
    Posts
    916
    I have a mix of the official relays and these guys: http://www.bgmicro.com/REL1068.aspx
    All the "official" relays are in the car currently attached to my FBv4 so these are what I'm testing with in my dorm room.
    I was planning to change the ones in the car for these since these have nice screw-mounts, though it's in a project enclosure so it's not that big of a deal.

    Do you think those relays cause the problem? Though I still doubt my brain is in perfect working condition right now
    My Nearly Complete Car:
    http://www.mp3car.com/vbulletin/show...ed-car-pc.html

    Micro Control Center... Control Your Car Across the Internet
    http://www.mp3car.com/fusion-brain/1...-internet.html

    Website: (It's a work in progress, really. All my projects have taken me from ever really developing it.)
    http://paulfurtado.com/

  10. #10
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by PaulF View Post
    I have a mix of the official relays and these guys: http://www.bgmicro.com/REL1068.aspx
    All the "official" relays are in the car currently attached to my FBv4 so these are what I'm testing with in my dorm room.
    I was planning to change the ones in the car for these since these have nice screw-mounts, though it's in a project enclosure so it's not that big of a deal.

    Do you think those relays cause the problem? Though I still doubt my brain is in perfect working condition right now

    Those relays should be ok. 80ohm coil, so 150mA through the output circuit. The back EMF may be related, but the 12v overload thing probably not.

    So it only happens when the 12v is powering it correct?
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. Turn on a Light Bulb using Road Runner Fusion Brain and Road Runner Fusion Document
    By Batmaninls in forum FB Documentation and Tutorials
    Replies: 29
    Last Post: 07-12-2010, 09:06 PM
  2. New To Fusion Brain
    By Urbanmindz in forum Fusion Brain
    Replies: 17
    Last Post: 11-09-2008, 01:02 PM
  3. Fusion Brain and its uses!
    By HiJackZX1 in forum Fusion Brain
    Replies: 7
    Last Post: 06-08-2008, 06: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
  •