I found what I was looking. However the program doesn't seem to work
properly:
implementation
{
event void I2CResource.granted()
{
uint8_t cmd = 0x00;
if (call I2CBasicAddr.write(I2C_START | I2C_STOP, 0x48, 1,
(uint8_t*)(&cmd)) == SUCCESS)
{
}
}
async event void I2CBasicAddr.writeDone(error_t success, uint16_t addr,
uint8_t length, uint8_t *data)
{
call Leds.led1On();
}
async event void I2CBasicAddr.readDone(error_t success, uint16_t addr,
uint8_t length, uint8_t *data)
{
}
event void Boot.booted()
{
call Timer0.startPeriodic(2000);
}
event void Timer0.fired()
{
call I2CResource.request();
}
The writeDone (which should be called after having called the write) won't
ever be called and the led1 won't turn on. What am I missing here? Is it
possible that I have to initialize some register in the Msp430 controller or
to do some low lever stuff in order to get I2C to work?
--
View this message in context:
http://tinyos-help.10906.n7.nabble.com/XM1000-and-I2C-tp23281p23294.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help