Announcement

Collapse
No announcement yet.

Are the Digital Inputs Active?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


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

      Comment


      • #4
        yeah you need to pull it low with a resistor.

        its something we overlooked when we designed the board.

        Comment


        • #5
          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?

          Comment


          • #6
            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?

            Comment


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

              Comment


              • #8
                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?

                Comment


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

                  Comment


                  • #10
                    I guess that leaves one good answer...
                    It's been a while...

                    Comment


                    • #11
                      I have a question then. Can the firmware be re-written to use the digital inputs as analog. I need two more inputs and was planning on using the digitals.

                      Comment


                      • #12
                        Originally posted by RonS View Post
                        I have a question then. Can the firmware be re-written to use the digital inputs as analog. I need two more inputs and was planning on using the digitals.
                        No, it's a limitation of the board, if I remember correctly. The board can only handle 13 analog inputs, and only on certain pins. I'll check when I get home.

                        Comment


                        • #13
                          Ok thanks. I am going to get one of the new ones when they come out anyway. For right now I can do without the air fuel.

                          Comment


                          • #14
                            so to use them..

                            what size resistor would you suggest if you wanted to use a switch?

                            also i guess you will need to have the digital inputs code somewhere else and copy / paste it back into the .xml file each time you open the config and change anything?

                            as a thought could you treat them like a plugin or 3rd party item and refere to a 2nd .xml file just for the digital inputs

                            Comment


                            • #15
                              I think you can get away with a very high resistance, as you're just pulling the line to a voltage, and there shouldn't be any load on that line. I'd guess a 100K ohm resistor would be sufficient. I think you want to pull the sensed line to ground with that resistor, then put a switch between the sensed line and +5v. That way the input is normally grounded unless you press the switch, which pulls the input up to 5v.

                              Comment

                              Working...
                              X