NXC - Reading temperature from TPA81

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC - Reading temperature from TPA81

Post by mightor »

Tiago,

Thanks for responding so quickly :)

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
docilio
Posts: 5
Joined: 16 Jan 2012, 10:00

Re: NXC - Reading temperature from TPA81

Post by docilio »

mightor wrote:Tiago,

Thanks for responding so quickly :)

- Xander
No Problem Xander, I hope it helps...
Tiago Caldeira
www.nxt4you.com
RobocupJunior Rescue TC for 2012
RobocupJunior Rescue OC Co-Chair for Mexico2012
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: NXC - Reading temperature from TPA81

Post by afanofosc »

Can you look at how the OP was trying to use the device and correct his hardware configuration if there is anything wrong with it?

Can you get RobotC to work with this device using the standard LEGO I2C speeds? What does sensorI2CCustom mean? Is that different than how you would configure RobotC to communicate with the LEGO Ultrasonic sensor? Does custom mean "fast"?

Also, as you can see the NXC code looks identical to the RobotC code, so do you have any ideas why this device will be causing a bus error the way that the OP has his hardware configured?

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC - Reading temperature from TPA81

Post by mightor »

Well, there was mention of the usage of pull-ups which are apparently not supposed to be used. Tiago has used this device successfully in the past.

sensorI2CCustom is an I2C sensor at regular ~10k clock, no 9V pin. It's a vanilla I2C device.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
docilio
Posts: 5
Joined: 16 Jan 2012, 10:00

Re: NXC - Reading temperature from TPA81

Post by docilio »

mightor wrote:Well, there was mention of the usage of pull-ups which are apparently not supposed to be used. Tiago has used this device successfully in the past.

sensorI2CCustom is an I2C sensor at regular ~10k clock, no 9V pin. It's a vanilla I2C device.

- Xander

For some reason, the robot-electronic devices (eg.: SRF08 and TPA81) don't need pull up resistor. They have some kind of non planned resistance that doesn't need to put external ones.

Xander, could you replicate the i2c scanner program to NXC ?
Tiago Caldeira
www.nxt4you.com
RobocupJunior Rescue TC for 2012
RobocupJunior Rescue OC Co-Chair for Mexico2012
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: NXC - Reading temperature from TPA81

Post by afanofosc »

So both of you have looked at the picture of his hardware and are certain that he has everything connected correctly?

As far as I can gather he has tried it with and without pullup resistors.

Porting RobotC code to NXC is extremely simple. I probably already have an i2c scanner program written in NXC.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC - Reading temperature from TPA81

Post by mightor »

I am not going to have much time between now and next Saturday to do much roboting/programming. So I won't be able to do it.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: NXC - Reading temperature from TPA81

Post by afanofosc »

Perhaps you would have time to tell me what he meant by "the i2c scanner program".

Does he mean mindsensors.com scandev utility which I ported to NXC back in July of 2007 or something else you wrote more recently?

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC - Reading temperature from TPA81

Post by mightor »

On the new ROBOTC firmwares there's a tryme program that's an I2C device scanner. It's probably very much like the Mindsensors one :)

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: NXC - Reading temperature from TPA81

Post by afanofosc »

The comment at the start of i2c_scanner.c says
// It is based on a program original written by Dr. Nitin Patil of Mindsensors and modified
// by Scott Briscoe.
So it's the same, in essence, as my NXC version of the mindsensors.com scandev.c program which I wrote back in 2007. There's no way that scanner could possibly work in this case since the TPA81 doesn't support register 0x10 (which is what the scanner program tries to read 8 bytes from).

Some guy name Xander on another site said this device requires pull-up resistors

http://www.robotc.net/forums/viewtopic. ... 203#p12203

That seems to contradict what was said above.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests