TI中文支持网
TI专业的中文技术问题搜集分享网站

MCU SPI接口与多个从设备通信

Other Parts Discussed in Thread:TM4C129DNCPDT

类似cortex m3  m4这种MCU,自带2个SPI接口,比如有40个从设备,怎么使用合适呢,有什么芯片有提高SPI的驱动能力,板内通信的话

Ben Qin:

你好,请问具体器件型号是?

,

hua yan:

可以用SN74LVC245对SPI接口的SCK、MOSI、MISO增强驱动能力吗

,

Ben Qin:

参考下这篇帖子:

e2echina.ti.com/…/94679

,

hua yan:

比如TM4C129DNCPDT通过SPI口控制40个TMC5160芯片,怎么对SPI口进行处理呢?怎么增强SPI的驱动能力?

,

Ben Qin:

我咨询资深工程师后回复您。

,

Ben Qin:

你好,下面是工程师的回复:

我认为40个外部器件在 SPI 引脚上的负载可能太大。 默认情况下、SPI 引脚配置为2mA 驱动强度。 您可以修改 TivaWare 库以改变为8mA 或12mA 等驱动强度。 您将需要使用更高的强度比如12mA,来确定它是否能够提供足够的上升/下降时间以及从器件所需的 SPI 频率。 

通常、你可以调用 GPIOPinTypeSSI 来配置 GPIO 引脚以实现 SSI 功能。 正如您在 SSI 功能中看到的、默认情况下、2mA 用作驱动强度。 您可以将驱动强度更改为更高的值、例如12mA 或8mA、然后重建外设驱动程序库。 或者、您可以将此文件复制到工作项目中,对其进行更新然后编译它。

 

////! Configures pin(s) for use by the SSI peripheral.//!//! \param ui32Port is the base address of the GPIO port.//! \param ui8Pins is the bit-packed representation of the pin(s).//!//! The SSI pins must be properly configured for the SSI peripheral to function//! correctly. This function provides a typical configuration for those//! pin(s); other configurations may work as well depending upon the board//! setup (for example, using the on-chip pull-ups).//!//! The pin(s) are specified using a bit-packed byte, where each bit that is//! set identifies the pin to be accessed, and where bit 0 of the byte//! represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on.//!//! \note This function cannot be used to turn any pin into a SSI pin; it only//! configures a SSI pin for proper operation. Note that a GPIOPinConfigure()//! function call is also required to properly configure a pin for the SSI//! function.//!//! \note A subset of GPIO pins on Tiva devices, notably those used by the//! JTAG/SWD interface and any pin capable of acting as an NMI input, are//! locked against inadvertent reconfiguration. These pins must be unlocked//! using direct register writes to the relevant GPIO_O_LOCK and GPIO_O_CR//! registers before this function can be called. Please see the “gpio_jtag''//! example application for the mechanism required and consult your part//! datasheet for information on affected pins.//!//! \return None.////*****************************************************************************voidGPIOPinTypeSSI(uint32_t ui32Port, uint8_t ui8Pins){//// Check the arguments.//ASSERT(_GPIOBaseValid(ui32Port));

//// Make the pin(s) be peripheral controlled.//GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_HW);

//// Set the pad(s) for standard push-pull operation.//GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);}

赞(0)
未经允许不得转载:TI中文支持网 » MCU SPI接口与多个从设备通信
分享到: 更多 (0)