ROBOTC.net forums
http://www.robotc.net/forums/

Help with SMUX and IR Seekerv2
http://www.robotc.net/forums/viewtopic.php?f=41&t=2411
Page 1 of 1

Author:  l0jec [ Tue Jun 08, 2010 1:58 am ]
Post subject:  Help with SMUX and IR Seekerv2

Xander,
I have a new sensor multiplexer from Hi-Technic and a couple of IR Seekers (v2) and wanted to try using them together.

I am using your driver suite, specifically HTIRS2-driver.h which seems to work great... until I tried using it through the smux.

The first issue I ran into was that the HTSMUXscanPorts() only seemed to want to work if the smux was connected to s1. It seems from the documentation that I should be able to connect it up to any sensor port and just remember to address the sensors appropriately (ie. msensor_S1_1 vs msensor_S3_2).

The second issue I ran into is that I seem to be getting a single return value back and subsequent calls to get update values return the same initial junk. I thought it may be something with my code, but I found that your example/test program HTIRS2-SMUX-test1.c is giving me the same behavior.
I'm not sure if I have a hardware issue or something goofy somewhere else, but any help would be much appreciated!

I've attached a screenshot of the remote screen I get when running HTIRS2-SMUX-test1.c with the smux connected to s1 and an IR Seeker connected to ports 1 & 2 on it.
I'm using ROBOTC 2.03 (the latest build for FTC which resolved the license issue).

Thanks,
l0jec

Attachments:
Screen.JPG
Screen.JPG [ 26.26 KiB | Viewed 10294 times ]

Author:  mightor [ Tue Jun 08, 2010 2:13 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

The test program is only made to poll the IR Seeker on SMUX channel 1. If you want it to read from another port, you will have to modify the test program. The test program is just that, a small program to test the driver and give an example of how to use the API :)

If you have modified the test program, be sure to attach it to this thread.

- Xander

Author:  l0jec [ Tue Jun 08, 2010 3:00 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

Thanks for the quick reply.
Modifying the test program didn't seem help with the sensor port issue when I was messing with it, but the real problem is the values not being upated regardless of where I plug the smux in. In that regard, I think I discovered the exact scenario by experimentation.
By removing the second IR Seeker from the smux, the values for the first begin updating. It does not matter what port on the smux I plug it into.. as long as there are two IR Seekers plugged in, neither seem to work.
As a workaround in my own program, I have moved an US sensor to one of the other ports on the smux and the second IR Seeker to sensor port 4 on the NXT & that appears to be working fine.

Any ideas why I cannot use two IR Seekers on the same smux?

Author:  mightor [ Tue Jun 08, 2010 3:14 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

I can take a peek at the code. I don't have two of them so it's hard to duplicate. I'll get back to you :)

Xander

Author:  mightor [ Tue Jun 08, 2010 3:28 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

Can you run this program (it's an .rxe). It should work fine with ROBOTC 2.02. Let me know if the battery status changes if the 2nd IR Seeker is connected.

- Xander

Attachments:
HTIRS2-SMUX-tes.zip [2.77 KiB]
Downloaded 562 times

Author:  l0jec [ Tue Jun 08, 2010 8:53 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

Sure; I'm at work now, so I won't be able to test it until this evening.
Will post the results.

EDIT:
If it helps, I noticed that having the second IR Seeker plugged in only made a difference when I re-started the program. That is, plugging the second IR Seeker in & out while the code is running makes no difference; you have start the program with it plugged in or not to see the change in behavior.

Author:  l0jec [ Tue Jun 08, 2010 8:38 pm ]
Post subject:  Re: Help with SMUX and IR Seekerv2

Xander,
I downloaded the program to the NXT, but when I run it I just get an error msg on the NXT screen saying "Bad Version!" and it then exits.
Not sure if that helps.
Thanks,
l0jec

Author:  mightor [ Wed Jun 09, 2010 12:50 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

That means you are not running ROBOTC 2.02. What are you running?

- Xander

Author:  l0jec [ Wed Jun 09, 2010 10:07 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

Sorry, I'm running 2.03, the latest build for FTC which resolved the license issue (http://www.robotc.net/ftc/).

Author:  mightor [ Wed Jun 09, 2010 11:22 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

That would explain why it doesn't work. I compiled it on 2.02. I've attached the program. Make sure you use the latest version of the driver suite. You can download it here: [LINK].

- Xander

Attachments:
HTIRS2-SMUX-test1.c [4.73 KiB]
Downloaded 586 times

Author:  l0jec [ Wed Jun 09, 2010 9:30 pm ]
Post subject:  Re: Help with SMUX and IR Seekerv2

The battery status did not change when I added the second IR Seeker to smux.

Author:  mightor [ Thu Jun 10, 2010 1:00 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

I might write you a quick NXC program in the next few days or so to rule out my drivers. There is no way for me recreate this problem here since I don't have two of these. It's a very strange problem, for sure. I can't see a problem in the code either. I've had multiple sensors of the same kind connected to the SMUX before and it's never been a problem.

Does it make a difference which one is connected to the SMUX channel 1 and 2?

- Xander

Author:  l0jec [ Tue Jun 15, 2010 9:07 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

Quote:
Does it make a difference which one is connected to the SMUX channel 1 and 2?

Did not appear to make a difference if I switched them around.

It is certainly an odd one, but I think knowing the scenario and having a workaround is enough for anyone else who runs into the issue for now. If you happen to come up with an idea and need someone with two IR Seekers and a smux to test it out for you, feel free to shoot me a message.

Thanks for the help,
l0jec

Author:  mightor [ Tue Jun 15, 2010 9:11 am ]
Post subject:  Re: Help with SMUX and IR Seekerv2

l0jec,

Will do. I will try to get a hold of a second seeker and test it here with the debugger and protocol analyser.

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/