This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] McbspB 至 SPI 模式:在时钟停止模式中、接收器始终为0xFF、无延迟

Guru**** 2042920 points
Other Parts Discussed in Thread: C2000WARE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1045892/mcbspb-to-spi-mode-the-receiver-is-always-0xff-in-clock-stop-mode-without-delay

器件型号:TMS320F28335
主题中讨论的其他器件:C2000WARE

您好:

   我使用的演示代码为"F:\c2000_sdk\C2000Ware_1_00_03_00\device_support\F2833x\examples\McBSP_loopback_DMA"。 我将 McBSP_SPI 模式从 DLB 更改为时钟停止模式。 SPI 的 CLK 为400kHz。

   我想使用 MCBSPB 作为 SPI 模式来与 SD 卡通信。 下面是我的配置。

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void InitMcbspbGpio(void)
{
EALLOW;
// Configure McBSP-A pins using GPIO regs
// This specifies which of the possible GPIO pins will be McBSP functional
// pins.
// Comment out other unwanted lines.
GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 3; // GPIO12 is MDXB pin MOSI
GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 3; // GPIO13 is MDRB pin MISO
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 3; // GPIO14 is MCLKXB pin CLK
GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 3; // GPIO15 is MFSXB pin
// Enable internal pull-up for the selected pins
// Pull-ups can be enabled or disabled by the user.
// This will enable the pullups for the specified pins.
// Comment out other unwanted lines.
GpioCtrlRegs.GPAPUD.bit.GPIO12 = 0; //Enable pull-up on GPIO12 (MDXB)
GpioCtrlRegs.GPAPUD.bit.GPIO13 = 0; //Enable pull-up on GPIO13 (MDRB)
GpioCtrlRegs.GPAPUD.bit.GPIO14 = 0; //Enable pull-up on GPIO14 (MCLKXB)
GpioCtrlRegs.GPAPUD.bit.GPIO15 = 0; //Enable pull-up on GPIO15 (MFSXB)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

我需要使用400kHz CLK 来发送 cmd 来初始化 SD 卡。 但是、不管我在"DXR1"中发送什么、接收寄存器"DRR1"将始终为0xFF。  

我的 McBSP 配置是否有任何问题?

顺便说一下、由于硬接线电路是固定的、我无法执行回路测试。 此外、我已禁用 TX 和 Rx 中断、这很重要吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    到目前为止、我没有发现您的配置有任何问题。 它似乎与 TRM 中记录的 SPI 模式所需的所有寄存器值相匹配。 您是否完全能够探测 SPI 引脚、以便使用逻辑分析仪或示波器来显示它们、以查看实际发送的内容?

    惠特尼