Hello,
Just got my Teensy 3.0 board a few days ago and I've been having fun with it. Pretty awesome stuff. I've hooked up a bunch of sensors and such and everything is going well. However, I'm stumped at getting the Sparkfun si4707 breakout board going (it's a Weather Radio with SAME).
I've put a bunch of Serial.println statements here and there to see why it's not working. In the si4707_system_functions.cpp file-
// Read a specified number of bytes via the I2C bus.
// Will timeout if there is no response from the address.
void i2cReadBytes(byte number_bytes, byte * data_in)
{
int timeout = 1000;
Wire.requestFrom((byte) SI4707_ADDRESS, number_bytes);
while ((Wire.available() < number_bytes) && (--timeout))
;
while((number_bytes--) && timeout)
{
*data_in++ = Wire.read();
}
Wire.endTransmission();
}
// Write a specified number of bytes to the Si4707.
void i2cWriteBytes(uint8_t number_bytes, uint8_t *data_out)
{
Wire.beginTransmission(SI4707_ADDRESS);
while (number_bytes--)
{
Wire.write(*data_out++);
}
Serial.println("before end");
Wire.endTransmission();
Serial.println("after end");
}
The code calls i2cReadBytes to get a status byte, that works. The chip reports back 0x80 which means data can be sent. Then it attempts to send a command and i2cWriteBytes is called. In the above, "before end" get output on the serial line, but "after end" doesn't. I'm concluding that it is hanging on Wire.endTransmission().
This is the first command that is sent to the board.
Hoping someone can shed some light on this.
Just got my Teensy 3.0 board a few days ago and I've been having fun with it. Pretty awesome stuff. I've hooked up a bunch of sensors and such and everything is going well. However, I'm stumped at getting the Sparkfun si4707 breakout board going (it's a Weather Radio with SAME).
I've put a bunch of Serial.println statements here and there to see why it's not working. In the si4707_system_functions.cpp file-
// Read a specified number of bytes via the I2C bus.
// Will timeout if there is no response from the address.
void i2cReadBytes(byte number_bytes, byte * data_in)
{
int timeout = 1000;
Wire.requestFrom((byte) SI4707_ADDRESS, number_bytes);
while ((Wire.available() < number_bytes) && (--timeout))
;
while((number_bytes--) && timeout)
{
*data_in++ = Wire.read();
}
Wire.endTransmission();
}
// Write a specified number of bytes to the Si4707.
void i2cWriteBytes(uint8_t number_bytes, uint8_t *data_out)
{
Wire.beginTransmission(SI4707_ADDRESS);
while (number_bytes--)
{
Wire.write(*data_out++);
}
Serial.println("before end");
Wire.endTransmission();
Serial.println("after end");
}
The code calls i2cReadBytes to get a status byte, that works. The chip reports back 0x80 which means data can be sent. Then it attempts to send a command and i2cWriteBytes is called. In the above, "before end" get output on the serial line, but "after end" doesn't. I'm concluding that it is hanging on Wire.endTransmission().
This is the first command that is sent to the board.
Hoping someone can shed some light on this.