TI论坛
直播中

周彦楠

7年用户 169经验值
私信 关注
[问答]

TM4C123GXL SPI调试FSS引脚电平为什么变化幅值只有0.2V左右?

TM4C123GXL  ssi0初始化后,观测CLK、FSS、MOSI的时序发现是正确的,但是FSS的信号电平只有0.2V的高低电平变化,而CLK 和MOSI的电平是3.3V。为什么会出现这种现象?而因脚上没有任何外接上下拉电阻和其他电路,有谁遇到过这样的情况吗?难道GPIOA[2:5]的配置哪里不对吗?下面是SSI0的初始化函数。
//
// The SSI0 peripheral must be enabled for use.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
//
// For this example SSI0 is used with PortA[5:2]. The actual port and pins
// used may be different on your part, consult the data sheet for more
// information. GPIO port A needs to be enabled so these pins can be used.
// TODO: change this to whichever GPIO port you are using.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
//
// Configure the pin muxing for SSI0 functions on port A2, A3, A4, and A5.
// This step is not necessary if your part does not support pin muxing.
// TODO: change this to select the port/pin you are using.
//
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
GPIOPinConfigure(GPIO_PA3_SSI0FSS);
GPIOPinConfigure(GPIO_PA4_SSI0RX);
GPIOPinConfigure(GPIO_PA5_SSI0TX);
//
// Configure the GPIO settings for the SSI pins. This function also gives
// control of these pins to the SSI hardware. Consult the data sheet to
// see which functions are allocated per pin.
// The pins are assigned as follows:
// PA5 - SSI0Tx
// PA4 - SSI0Rx
// PA3 - SSI0Fss
// PA2 - SSI0CLK
// TODO: change this to select the port/pin you are using.
//
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2);
//
// Configure and enable the SSI port for SPI master mode. Use SSI0,
// system clock supply, idle clock level low and active low clock in
// freescale SPI mode, master mode, 1MHz SSI frequency, and 8-bit data.
// For SPI mode, you can set the polarity of the SSI clock when the SSI
// unit is idle. You can also configure what clock edge you want to
// capture data on. Please reference the datasheet for more information on
// the different SPI modes.
//
SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
SSI_MODE_MASTER, 200000, 8);
//
// Enable the SSI0 interrupt.
//
ROM_IntEnable(INT_SSI0);
SSIIntEnable(SSI0_BASE,SSI_RXFF);

// HWREG(SSI0_BASE + SSI_O_CR1) |= SSI_CR1_LBM;
// HWREG(SSI0_BASE + SSI_O_CR1) |= SSI_CR1_SSE;

//
// Enable the SSI0 module.
//
SSIEnable(SSI0_BASE);
//
// Enable processor interrupts.
//
ROM_IntMasterEnable();

回帖(3)

周彦楠

2018-8-14 07:31:38
举报

韦明

2018-8-14 07:46:00

奇怪,你配置为普通IO,单独拉高或者拉低PA3的电平,看看波形,像是外部电路影响了PA3口的电平。
举报

周彦楠

2018-8-14 07:51:36
引用: ljmlvmd 发表于 2018-8-14 07:46
奇怪,你配置为普通IO,单独拉高或者拉低PA3的电平,看看波形,像是外部电路影响了PA3口的电平。

按您说的配置为普通IO口,直接进行拉低或者拉高控制就没有问题了,可以正常收发了。谢谢!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分