View unanswered posts | View active topics It is currently Tue Sep 16, 2014 5:32 pm






Reply to topic  [ 15 posts ] 
RobotC Driver suite HTSMUX support 
Author Message
Rookie

Joined: Tue Dec 11, 2012 9:19 pm
Posts: 31
Post RobotC Driver suite HTSMUX support
Why aren't some of the configuration functions for
both the compass and the ir seeker supported through
the mux?

For example...
Code:
ifdef __HTSMUX_SUPPORT__
// ---------------------------- DC Signal processing -----------------------------
int HTIRS2readDCDir(tMUXSensor muxsensor);
bool HTIRS2readAllDCStrength(tMUXSensor muxsensor, int &dcS1, int &dcS2, int &dcS3, int &dcS4, int &dcS5);
int HTIRS2readDCAverage(tMUXSensor muxsensor);
// ---------------------------- AC Signal processing -----------------------------
int HTIRS2readACDir(tMUXSensor muxsensor);
bool HTIRS2readAllACStrength(tMUXSensor muxsensor, int &acS1, int &acS2, int &acS3, int &acS4, int &acS5);

bool HTIRS2readEnhanced(tMUXSensor muxsensor, int &dir, int &strength);

tConfigParams HTIRS2_config = {HTSMUX_CHAN_I2C, 13, 0x10, 0x42}; /*!< Array to hold SMUX config data for sensor */
#endif // __HTSMUX_SUPPORT__


Note that
Code:
bool HTIRS2setDSPMode(tSensors link, tHTIRS2DSPMode mode);

is not in that list and there's no implementation for it for the mux elsewhere in
the file. Similar omissions exist for compass calibration functions.


Thu Dec 13, 2012 7:59 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: RobotC Driver suite HTSMUX support
Because the mux only allows reading from the sensors hooked to it but not writing to them. So unless the default mode of the sensor is what you want, good luck with changing sensor mode to non-default. I supposed that's why they call it "Sensor MUX" and not generic I2C MUX.


Fri Dec 14, 2012 2:39 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: RobotC Driver suite HTSMUX support
^-- What MHTS said.

It is a hardware limitation, no amount of programming or tweaking on my side will change that. If it's not in my driver suite, you can be pretty sure the sensor does not support it; I tend to expose all of the available functionality.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Dec 14, 2012 5:49 am
Profile WWW
Rookie

Joined: Tue Dec 11, 2012 9:19 pm
Posts: 31
Post Re: RobotC Driver suite HTSMUX support
Thanks for the response. That explains it.

We calibrated the compass by bypassing the mux.

For the IR seeker does anyone know if it defaults to the 1200hz DSP mode?

Odd though that the mux does not allow writes given that
you can get one of these

http://www.nxp.com/documents/data_sheet/PCA9548A.pdf

for about a dollar in quantity and you'll get full bi-directional
data flow. Then it's just a matter of getting the NXT brick to
understand how to select the correct port.

Given that it's possible to do generic i2c writes out a given link
it would seem that given a through hole package (i can't do surface
mount soldering), and appropriate connectors for the brick cables
it wouldn't be too difficult to build a pca9548 based mux to work with
lego sensors.

And for FTC it would be nice to have one with a voltage regulator, 7805,
to step down the voltage from the battery so it doesn't need a
separate battery pack.

But thanks Xander, I always refer to you as the nice man from Europe
who wrote all that nice software my kids are using. They laugh at me.


Sat Dec 15, 2012 12:54 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: RobotC Driver suite HTSMUX support
skatefriday wrote:
Thanks for the response. That explains it.
For the IR seeker does anyone know if it defaults to the 1200hz DSP mode?

Yes, which also happens to be the standard frequency used by the IR beacons.

Quote:
Odd though that the mux does not allow writes given that you can get one of these

Maybe some company will come up with something like that. That wouldn't work with the analogue sensors, though.

Quote:
And for FTC it would be nice to have one with a voltage regulator, 7805, to step down the voltage from the battery so it doesn't need a separate battery pack.

I have a prototype HT SMUX (one of the first ones) with a nice Power Functions lead out of it, so I just hook it up to one of those battery packs.

Quote:
But thanks Xander, I always refer to you as the nice man from Europe who wrote all that nice software my kids are using. They laugh at me.

Hah, I would probably laugh at that, too :) Thanks for the compliment!

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Dec 15, 2012 1:39 am
Profile WWW
Rookie

Joined: Tue Dec 11, 2012 9:19 pm
Posts: 31
Post Re: RobotC Driver suite HTSMUX support
mightor wrote:
Maybe some company will come up with something like that. That wouldn't work with the analogue sensors, though.


Also oddly enough we could not get the touch sensor to work through
the mux. We have the compass and IR sensor working, but add in the
touch sensor and it was a constant read of 1. The sensor works fine
directly connected to the nxt. And yes, we were using your library
functions and appropriate declarations for reading the touch sensor
through the mux vs the RobotC primitives and basic pragma setup
for reading it directly.

Quote:
I have a prototype HT SMUX (one of the first ones) with a nice Power Functions lead out of it, so I just hook it up to one of those battery packs.


Please send me one. :-)


Sat Dec 15, 2012 1:47 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: RobotC Driver suite HTSMUX support
Hrmm, are you using Driver Suite 3.2 and the 3.55 beta 2 ROBOTC? I know there were casting issues in previous versions but I thought they were fixed in beta 2.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Dec 15, 2012 1:53 am
Profile WWW
Rookie

Joined: Tue Dec 11, 2012 9:19 pm
Posts: 31
Post Re: RobotC Driver suite HTSMUX support
mightor wrote:
Hrmm, are you using Driver Suite 3.2 and the 3.55 beta 2 ROBOTC? I know there were casting issues in previous versions but I thought they were fixed in beta 2.

= Xander


We are using RobotC 3.54 and whatever came before Driver Suite 3.2.

I fixed your signed/unsigned warnings in the ir-seeker file, and was going to
send you a diff when I noticed that you had released a new version and
looked at saw that you fixed them as well.


Sat Dec 15, 2012 2:11 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: RobotC Driver suite HTSMUX support
You should always use the latest of my driver suite, I only have enough time to support one version.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Dec 15, 2012 2:42 am
Profile WWW
Expert
User avatar

Joined: Fri Nov 02, 2012 12:07 am
Posts: 164
Location: California, USA
Post Re: RobotC Driver suite HTSMUX support
Xander is good at being helpful!

:lol: :lol: :lol: :lol: :lol: :lol:

_________________
string Robored = "Awesome"
~~Neil Balch~~


Sat Dec 15, 2012 11:37 pm
Profile WWW
Rookie
User avatar

Joined: Sat Sep 03, 2011 10:03 am
Posts: 32
Post Re: RobotC Driver suite HTSMUX support
[quote= "skatefriday"] Also oddly enough we could not get the touch sensor to work through
the mux. We have the compass and IR sensor working, but add in the
touch sensor and it was a constant read of 1. The sensor works fine
directly connected to the nxt. And yes, we were using your library
functions and appropriate declarations for reading the touch sensor
through the mux vs the RobotC primitives and basic pragma setup
for reading it directly.[/quote]

I had the same problem with the SMUX and the touch sensor always returning a 1.

I finally downloaded 3.55 Beta 2 with drivers 3.2.1 and i now seems to work properly. :D


Tue Dec 18, 2012 3:04 pm
Profile
Rookie

Joined: Mon Jan 07, 2013 11:44 pm
Posts: 3
Post Re: RobotC Driver suite HTSMUX support
Does anyone have any easy to use sample code for using the IR V2 on the MUX and returning the values 0 - 9?


Tue Jan 08, 2013 12:26 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3221
Location: Rotterdam, The Netherlands
Post Re: RobotC Driver suite HTSMUX support
Did you look at the hitechnic-irseeker-v2* programs? There should be a few SMUX examples in there.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Jan 08, 2013 3:07 am
Profile WWW
Rookie

Joined: Mon Jan 07, 2013 11:44 pm
Posts: 3
Post Re: RobotC Driver suite HTSMUX support
Yes I did but the programs I tried all returned raw values from the five independent channels. If you say there is sample code for returning values 0-9 Ill look harder.


Tue Jan 08, 2013 1:44 pm
Profile
Rookie

Joined: Mon Jan 07, 2013 11:44 pm
Posts: 3
Post Re: RobotC Driver suite HTSMUX support
Found it. Thank you.


Wed Jan 09, 2013 12:03 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.