Hello,
There is another questino confused me and ask your help,
I use the EKS-LM4F2323 Evaluation Kit and try to measure the waveform of I2C channel 0 SCL and SDA,
Below is the source code and made the I2C0 as master to send a character,
There are no slave device to connect to the I2C0 and i only use the scope to measure the GPIOB PB2 and PB3
on the EKS-LM4F2323 Evaluation Kit but i can not see any waveform after send the date on the I2C0,
Does anything wrong with the operate or the source code ?
Any comment will be appreciated, thanks
ps : 1. in API GPIOPadConfigSet() if the parameter set GPIO_PIN_TYPE_OD_WPU, i only see the SDA pull high but SCL keep in low
I think there are no pull up resistor , am i right ?
2. in API GPIOPadConfigSet() if the parameter set GPIO_PIN_TYPE_STD_WPU, both the SDA and SCL will be pulled high but still can not
see the waveform in the scope after send the data, what is the really parameter should be setting in this API?
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_i2c.h"
#include "driverlib/i2c.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "utils/uartstdio.h"
#include "inc/lm4f232h5qd.h"
#define SLAVE_ADDRESS 0x3C
void main(void) {
unsigned long reg='A';
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
GPIODirModeSet(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3, GPIO_DIR_MODE_HW);
GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_OD_WPU);
I2CMasterInitExpClk(I2C0_MASTER_BASE, SysCtlClockGet(), false);
I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, SLAVE_ADDRESS, false);
I2CMasterDataPut(I2C0_MASTER_BASE,reg);
I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_SINGLE_SEND);
while(1)
{}
}