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.

[参考译文] TMS570LC4357:使用 MOSI-3引脚作为 GPIO

Guru**** 2430620 points
Other Parts Discussed in Thread: HALCOGEN

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1298842/tms570lc4357-use-mosi-3-pin-as-gpio

器件型号:TMS570LC4357
主题中讨论的其他器件:HALCOGEN

尊敬的所有人:

TMS570LC 只有2个 GPIO 端口(A 和 B)、每个端口都有8个引脚、这意味着只有2个8个引脚可用于 GPIO 输出、

我要求40个 GPIO、因此我尝试使用外设引脚作为 GPIO

我想使用 SPI3-MOSI 引脚作为 GPIO、并对此进行了如下更改

/---------------------------------------------------------------------------------------------------------

int main (空)
{
gioInit ();
spiInit();
dataconfig1_t.CS_HOLD = 1;
dataconfig1_t.WDEL = false;

gioToggleBit (gioPORTB、7);       // LED
gioToggleBit (gioPORTB、6);       // LED
spiREG3->PC0 &=~(0x00FF0000);//mosi 作为 GPIO
spiREG3->PC1 |= 0x00FF0000;//方向作为输出
while (1)
{

spiREG3->PC3 |=(1 << SPI_PIN_SIMO_3);    //设置为高电平
delay_v ();
spiREG3->PC3 &=~(1 << SPI_PIN_SIMO_3);  //设置为低电平
delay_v ();
gioToggleBit (gioPORTB、7);            // LED
gioToggleBit (gioPORTB、6);           // LED
delay_v ();
}/*用户代码结束*/

返回0;

------------------ /

上述代码由 HALCoGen 软件生成  

其中 SPI 会初始化并尝试根据 SFR 将 MOSI 设置为 GPIO

问题- MOSI 引脚仅保持高电平状态、不按要求工作

因此、请告诉我实现逻辑共模的正确