我想配置一下I2c输出,这个程序是照例程改的,但是我用示波器观察SCL口(PB2口)却没有波形。我是把示波器接在GPIO口上,再按复位键,但是依然没有波形,请帮我看看问题出在哪了?谢谢
#include <stdint.h>
#include <stdbool.h>
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "driverlib/i2c.h"
#include "driverlib/udma.h"
#include "driverlib/adc.h"
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);// sysclock is 40Mhz
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
GPIOPinTypeI2C(GPIO_PORTB_BASE,GPIO_PIN_2|GPIO_PIN_3);//Configure the I2C pins
//add2lines
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);// Enable the I2C3 Moudle
I2CMasterEnable(I2C0_BASE);
I2CMasterInitExpClk(I2C0_BASE, SysCtlClockGet(), true);//400Kbps
I2CMasterSlaveAddrSet(I2C0_BASE, 0x44, false);//Specify slave address,Master read from the slave
I2CMasterDataPut(I2C0_BASE,'Q');// Place the character to be sent in the data register
I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);// Initiate send of character from Master to Slave
// Delay until transmission completes
while(I2CMasterBusBusy(I2C0_BASE))
{
}
}
我就是想看看这样配置是不是成功了,能不能发送数据,请问有别的调试方式吗?希望指点