Other Parts Discussed in Thread: LM75A
Hello ;
We aim to use LM75A sensor to measure temperature . We couldnt make i2c comminication between sensor and our controller card . Main problem is that we cant build i2c pins . We follow instructions for tiva c series for our card . When we observe on oscilloscope , we cant see clock wave on SCL line .
We have slave address that is 0x00 . We connect sensor address pins to ground .
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_i2c.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/i2c.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "inc/tm4c129xnczad.h"
#include <Wire.h>
#define SLAVE_ADDRESS 0x00
void setup() {
Serial.begin(9600);
Serial.print("asd0");
GPIOPinConfigure(GPIO_PK6_I2C4SCL);
GPIOPinConfigure(GPIO_PK7_I2C4SDA);
GPIOPinTypeI2C(GPIO_PORTK_BASE, (1 << 7)); // Configures SDA
GPIOPinTypeI2CSCL(GPIO_PORTK_BASE, (1 << 6)); // Configures SCL
Serial.print("test1");
I2CMasterInitExpClk(I2C4_BASE, g_ui32SysClock, false);
I2CSlaveEnable(I2C4_BASE);
Serial.print("test2");
I2CSlaveInit(I2C4_BASE, SLAVE_ADDRESS);
I2CMasterSlaveAddrSet(I2C4_BASE, SLAVE_ADDRESS, false);
Serial.print("test3");
}