Page 3 of 4

Re: NXC - Reading temperature from TPA81

Posted: 16 Jan 2012, 11:29
by mightor
Tiago,

Thanks for responding so quickly :)

- Xander

Re: NXC - Reading temperature from TPA81

Posted: 16 Jan 2012, 11:47
by docilio
mightor wrote:Tiago,

Thanks for responding so quickly :)

- Xander
No Problem Xander, I hope it helps...

Re: NXC - Reading temperature from TPA81

Posted: 16 Jan 2012, 18:59
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

Re: NXC - Reading temperature from TPA81

Posted: 16 Jan 2012, 20:38
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

Re: NXC - Reading temperature from TPA81

Posted: 17 Jan 2012, 00:09
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 ?

Re: NXC - Reading temperature from TPA81

Posted: 17 Jan 2012, 03:27
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

Re: NXC - Reading temperature from TPA81

Posted: 17 Jan 2012, 06:40
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

Re: NXC - Reading temperature from TPA81

Posted: 17 Jan 2012, 17:42
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

Re: NXC - Reading temperature from TPA81

Posted: 17 Jan 2012, 20:45
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

Re: NXC - Reading temperature from TPA81

Posted: 18 Jan 2012, 02:25
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