Hi everyone!

I need some help...I'm trying to use I2C bus on micaz communicate with a LCD
I2C display... The program that I'm writing is very simple and I'm showing
below:

My configuration file:

configuration MasterAppC
{
}
implementation
{
  components MainC, LedsC, MasterC;
  components new Atm128I2CMasterC();   

  MasterC -> MainC.Boot;
  MasterC.Leds -> LedsC;
  MasterC.Resource -> Atm128I2CMasterC;
  MasterC.I2C -> Atm128I2CMasterC;
}


My program file:

#include "I2C.h"

module MasterC 
{
  uses interface Leds;
  uses interface Boot;
  uses interface I2CPacket<TI2CBasicAddr> as I2C;
  uses interface Resource;
  uses interface GeneralIO as IO;
}
implementation
{
  event void Boot.booted()   
   {
        call Resource.request();  //pedido acesso ao I2c...
        
   }
   event void Resource.granted()  //acesso ao I2C concedido...
   {
        static uint8_t Buffer[2]= { 12, 19};
        
        if (call I2C.write(I2C_START | I2C_STOP, 0xC6, sizeof Buffer, Buffer)
== SUCCESS) 
        {
                call Leds.led1On();
        }
   }
  
   async event void I2C.readDone(error_t error, uint16_t addr, uint8_t
length, uint8_t* data) 
  {
        call Leds.led0On();
        call Resource.release();
  }
  
   async event void I2C.writeDone(error_t error, uint16_t addr, uint8_t
length, uint8_t* data) 
  {
        call Leds.led0On();  
  }
}

My Makefile:

COMPONENT=MasterAppC
SENSORBOARD=mts300
include $(MAKERULES)

This program have no compile errors but I don't have any response from
LCD...I'm using ubuntu 9.1...I also used a digital osciloscope to see the
DATA and CLOCK signals but they always stays at 0! I'm wondering if I have
to add some command to the makefile...because I have no idea why this don't
works...


-- 
View this message in context: 
http://old.nabble.com/TinyOS-2.1.0-I2c-on-micaz%21%21-tp28475763p28475763.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

Reply via email to