Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > General Hardware Discussion > Fusion Brain > FB Sensors


Reply
 
Share Thread Tools Display Modes
Old 07-29-2008, 10:08 AM   #1
Newbie
 
Join Date: Jul 2008
Posts: 7
steve2009 is an unknown quantity at this point
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?
steve2009 is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 07-30-2008, 03:44 PM   #2
Constant Bitrate
 
mx270a's Avatar
 
Join Date: Aug 2003
Location: Iowa
Posts: 167
mx270a is on a distinguished road
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
mx270a is offline   Reply With Quote
Old 07-30-2008, 04:50 PM   #3
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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.
2k1Toaster is offline   Reply With Quote
Old 07-30-2008, 07:59 PM   #4
Fusion Brain Creator
 
Join Date: Mar 2005
Posts: 2,197
greenman100 is on a distinguished road
yeah you need to pull it low with a resistor.

its something we overlooked when we designed the board.
greenman100 is offline   Reply With Quote
Old 07-31-2008, 12:14 AM   #5
Newbie
 
Join Date: Jul 2008
Posts: 7
steve2009 is an unknown quantity at this point
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?
steve2009 is offline   Reply With Quote
Old 07-31-2008, 03:16 PM   #6
Newbie
 
Join Date: Jul 2007
Posts: 39
ginigma is an unknown quantity at this point
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?
ginigma is offline   Reply With Quote
Old 07-31-2008, 11:10 PM   #7
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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.
2k1Toaster is offline   Reply With Quote
Old 08-01-2008, 11:01 AM   #8
Newbie
 
Join Date: Jul 2007
Posts: 39
ginigma is an unknown quantity at this point
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?
ginigma is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 08-01-2008, 04:49 PM   #9
Fusion Brain Creator
 
2k1Toaster's Avatar
 
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future2k1Toaster has a brilliant future
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.

Last edited by 2k1Toaster; 08-01-2008 at 04:57 PM.
2k1Toaster is offline   Reply With Quote
Old 08-01-2008, 04:54 PM   #10
FLAC
 
Join Date: Oct 2006
Location: Las Vegas
Posts: 1,283
h3rk will become famous soon enough
I guess that leaves one good answer...
h3rk is offline   Reply With Quote
Old 08-20-2008, 10:54 AM   #11
Low Bitrate
 
Join Date: Dec 2007
Posts: 105
RonS is an unknown quantity at this point
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.
RonS is offline   Reply With Quote
Old 08-20-2008, 12:38 PM   #12
Fusion Brain Creator
 
Join Date: Mar 2005
Posts: 2,197
greenman100 is on a distinguished road
Quote: 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.
greenman100 is offline   Reply With Quote
Old 08-21-2008, 07:30 AM   #13
Low Bitrate
 
Join Date: Dec 2007
Posts: 105
RonS is an unknown quantity at this point
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.
RonS is offline   Reply With Quote
Old 08-21-2008, 05:57 PM   #14
Maximum Bitrate
 
Woofnstuff's Avatar
 
Join Date: Oct 2007
Location: Auckland
Posts: 558
Woofnstuff is an unknown quantity at this point
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
__________________


Last edited by Woofnstuff; 08-21-2008 at 08:09 PM.
Woofnstuff is offline   Reply With Quote
Old 08-21-2008, 08:05 PM   #15
Constant Bitrate
 
mx270a's Avatar
 
Join Date: Aug 2003
Location: Iowa
Posts: 167
mx270a is on a distinguished road
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.
mx270a is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SDPIF digital Coax into car audio pieces RedGTiVR6 Car Audio 34 10-14-2008 01:06 AM
idea for digital inputs wilgartw Fusion Brain 11 03-27-2008 05:23 PM



All times are GMT -5. The time now is 08:36 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics