Tool/software: Code Composer Studio
Hello ,
I am just begining of this card software . I have a problem with i2c . I just wanna make sure i2c pin are activated or note . I mean my codes are right or not . I just follow code flow from Using Feature Set of I2C Master on TM4C129x .
My goal is to control i2c pins are working . Thats why I just do step : Configuration of IO’s . My problem is pins are not activated . I just control SCL pin . I need to get clock graph on oscilloscope . But I cant . My code is below ;
Note that : I just wanna check 2 port they are working or not .
#include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include "inc/hw_i2c.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "inc/hw_gpio.h" #include "driverlib/i2c.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "driverlib/pin_map.h" /** * main.c */ int main(void) { //Enable GPIO for Configuring the I2C Interface Pins SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL); // // Wait for the Peripheral to be ready for programming // while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOB) || !SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOL)); // // Configure Pins for I2C2 Master Interface // GPIOPinConfigure(GPIO_PB2_I2C0SCL); GPIOPinConfigure(GPIO_PB3_I2C0SDA); GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3); GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2); // // GPIOPinConfigure(GPIO_PL1_I2C2SCL); GPIOPinConfigure(GPIO_PL0_I2C2SDA); GPIOPinTypeI2C(GPIO_PORTL_BASE, GPIO_PIN_0); GPIOPinTypeI2CSCL(GPIO_PORTL_BASE, GPIO_PIN_1); return 0; }