Microchip
直播中

方娟

8年用户 188经验值
私信 关注
[问答]

请问配置两个函数的同一个PIN有什么更新吗?

关于配置两个函数的同一个PIN有什么更新吗?对于PIC32 MX795F512L中的PN10(RG6),可以使用ECOOL/SCK2/U6TX/U3RTS/PMA5或CN8。那么,如何配置UTART和SPI功能的PIN管呢?功能1:SPI1(SCK2)的同步串行时钟输入/输出。功能2: UART6传输(U6TX)。

以上来自于百度翻译


      以下为原文

    Are there any updates about configuring the same Pin for two functions?
For exemple in  PIC32MX795F512L pin10 (RG6) can be used as ECOL/SCK2/U6TX/U3RTS/PMA5 or CN8.
So How can I configure this pin for UART and SPI functions?
Function1: Synchronous serial clock input/output for SPI1 (SCK2).
Function2: UART6 transmit (U6TX).

Regards,

回帖(3)

吴键洪

2018-10-9 11:26:04
它只能是一个或另一个,而不是两者同时存在。

以上来自于百度翻译


      以下为原文

    It can only be one or the other, not both at the same time.
 
举报

李铭鑫

2018-10-9 11:40:22
嗨,你不能同时为2个这样的函数配置一个PIN。通过PIN功能的方式指示硬件优先级:ECOL/SCK2/U6TX/U3RTS/PMA5/CN8/RG6,其中左边的外设将重写右边的。在运行中,可以改变外围设备的使用。程序,禁用一个外围设备,并启用另一个。例如:禁用SPI:SPICONBITS.ON=0;然后启用UART:U6MODEBITS.ON=1;或者相反的方式。SPI设备将不响应UART6信号,如果所有的芯片选择线保持在禁用状态=高电平。如果有UART。接收器连接到PIN,然后它会变得非常混乱的SPI时钟信令,它会得到垃圾字符,帧错误和中断信号。您可能总是读取信号在PIN TURU PORTG寄存器。迈西尔

以上来自于百度翻译


      以下为原文

    Hi,
You cannot configure a pin for 2 such functions at the same time.
There is a hardware priority indicated by the way the pin functions are listed :
ECOL/SCK2/U6TX/U3RTS/PMA5/CN8/RG6   where peripherals to the left will override those to the right.
 
You may change the use of peripherals in the running program, by disabling one peripheral, and enabling another.
Example:  disable SPI:  SPICONbits.ON = 0; 
and then  enable UART:  U6MODEbits.ON = 1;
Or the opposite way around.
 
SPI devices will not respond to UART6 signals if all Chip Select lines are kept in the Disable state = High level.
If there is a UART receiver connected to the pin, then it will become mighty confused by SPI clock signaling, it will get garbage characters, framing errors and break signals.
 
You may always read the signal on the pin thru PORTG register.
 
   Mysil
 
举报

张雷

2018-10-9 11:58:22
问问自己:这个引脚的硬件连接会是什么样子?如果你希望PIN同时充当这两个东西,那么你可能会同时有两个独立的电路连接到PIN上。这些电路如何神奇地知道哪些信号是针对每个电路的,而“神奇地”忽略了“其他”电路的信号呢?这是一个更详细的方式同意早期的受访者:每个引脚最多可以做一个功能一次。我的观点是,如果你考虑硬件环境,这会立即变得明显。

以上来自于百度翻译


      以下为原文

    Ask yourself this: What would the hardware connection to that pin look like?
 
If you want the pin to function as both things at the same time, presumably you'd have two separate circuits connected to the pin at the same time. How will those circuits "magically" know which signals are intended for each circuit, while "magically" ignoring the signals intended for the "other" circuit?
 
This is a more detailed way of agreeing with the earlier respondents: Each pin can do, at most, one function at a time. My point is that if you think about the hardware environment, this becomes immediately obvious.
举报

更多回帖

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