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

Thread: Are the Digital Inputs Active?

  1. #1
    Newbie
    Join Date
    Jul 2008
    Posts
    7

    Are the Digital Inputs Active?

    I'm a newbie to the Fusion Brain and have just received it and have got it working. I've not be able to get a reading from the Digital Inputs yet.

    I've connected a switch across the two pins on one of the 4 Digital input ports and didn't see a change in byte 32 on the receive message (I'm using vb2008 to read the data via the FusionUSB.dll) Then I watched the entire 64byte message block and didn't see any bytes changing as I switched on and off.

    My specific question is: Are these 4 ports active on my build of the board (the latest I assume since I just received it this week). If so, what might I be doing wrong?

  2. #2
    Constant Bitrate mx270a's Avatar
    Join Date
    Aug 2003
    Location
    Iowa
    Posts
    167
    I abandoned the digital input ports in the VB code since it sounds like they will be going away in the next hardware release. The analog inputs can read a digital signal, so unless you run out of analog inputs, it shouldn't be a problem.

    As I recall, all 4 digital inputs are bits in one byte. What I noticed is that the digital inputs don't fall back to 0 right away when you disconnect them. So if you're using a normally-open push-button switch, it will go high as soon as you push the button, but it takes a while for it to go low when you let go of the button. The card has to drain off the voltage before it resets back to low. If you were driving it with something that can provide either 5volts or ground, it should work quite well.

    -Lance

  3. #3
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    They will be going away in the next hardware release, that is true.

    And also they do hold a voltage unless you put a drain on it.

    They are active on your board, and Tim tests all of them, so they should work. Probably just saturated with voltage if using a simple button on it.
    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

  4. #4
    Fusion Brain Creator
    Join Date
    Mar 2005
    Posts
    2,221
    yeah you need to pull it low with a resistor.

    its something we overlooked when we designed the board.

  5. #5
    Newbie
    Join Date
    Jul 2008
    Posts
    7
    Thanks for the info, it'll save me from wasting time... I'll try the pull down R. as well.

    I agree that valuable hw resources would be better applied to 4 additional analog ports, since they can also serve the same purpose as digital ports but not vice-versa.

    My only additional thought is that it's such a pain to debounce a switch at the high-level, it's so much more accurate and responsive at the low level.

    An elegant solution might be for the FB to provide a "shadow" debounced digital value for all analog ports on the bits in byte 32? That way if we're hooking up a button or switch to any analog port the high-level software can choose to look in 32 and get a nice clean firmware debounced 1/0, but if we want analog we look in the analog bytes. Might there be cpu cycles available for that bit of extra math?

  6. #6
    Newbie
    Join Date
    Jul 2007
    Posts
    39
    How do I add the Digital Input using the Configurator? Or if you can just post the xml I can add it.

    I am using a magnetic alarm contact that I just want to know if it's open or closed. Where and what value resistor should I use?

  7. #7
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Using the configurator, you cant.

    xml:
    Code:
          <iochannel id="ChannelID" port="0" brain="MyBrain" type="digital_input"></iochannel>

    You will notice that it is the exact same syntax as the other channels. Only difference is the type.
    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

  8. #8
    Newbie
    Join Date
    Jul 2007
    Posts
    39
    Thanks, that's great.
    However, once you add that manually, when you open the xml in the Configurator and save it again, all that work is lost. Can you fix the Configurator to ignore that so it doesn't remove it?

  9. #9
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    Quote Originally Posted by ginigma View Post
    Thanks, that's great.
    However, once you add that manually, when you open the xml in the Configurator and save it again, all that work is lost. Can you fix the Configurator to ignore that so it doesn't remove it?
    Yes the configurator throws out what it doesn't understand. The way that I have designed the configurator, it wont accept it without major changes. The program rebuilds the xml file from scratch every time you do anything. I can try and make some sort of ignore area, but the problem comes that if you place that line of code for the digital input anywhere else than the i/o section, it doesnt mean anything. So it cant just ignore something, it has to know what it is and where to put it.
    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

  10. #10
    FLAC
    Join Date
    Oct 2006
    Location
    Las Vegas
    Posts
    1,286
    I guess that leaves one good answer...

Page 1 of 2 12 LastLast

Similar Threads

  1. SDPIF digital Coax into car audio pieces
    By RedGTiVR6 in forum Car Audio
    Replies: 34
    Last Post: 10-14-2008, 12:06 AM
  2. idea for digital inputs
    By wilgartw in forum Fusion Brain
    Replies: 11
    Last Post: 03-27-2008, 04:23 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
  •