Microchip
直播中

李永每

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

怎么结合ICD引脚和UART引脚?

您好,在PIC18上,我习惯了,ICSP引脚与UART的RX/TX复用。这对于在“外部连接引脚”受限的环境中开发非常有用(盆装盒)。如果移动到PIC32MX795F512H,这种多路复用就不再是真的了。只是将UART引脚与ICSP引脚并联可能不是一个好主意。因为板空间也是有限的,那么对于ICSP和UART来说,共享外部连接引脚有什么好的解决方案?谢谢!*编辑:更改ICD到ICSP。ICD不是一个问题,因为开发是在没有设备被灌输的情况下完成的。

以上来自于百度翻译


      以下为原文

    Hello,

On the PIC18, I am used to, the ICSP-pins are multiplexed with the RX/TX of a UART. This is extremely useful to me developing in an environment where "outside connection pins" are limited (potted box).

Moving to a PIC32MX795F512H, this multiplexing is no longer true. Just parallelling UART-pins to ICSP-pins is probably not a good idea. Because boardspace is serverly limited as well, what would be a good, solid solution to share outside connection-pins for both ICSP and an UART?

Thanks!

*Edit: Changed ICD to ICSP. ICD is not an issue because development is done without the device being potted.

回帖(4)

朱佳婧

2019-6-6 11:20:39
您没有提到您正在使用哪个ICSP管脚集(可以选择多个ICSP管脚集),也没有提到您正在尝试使用哪个UART……最好的解决方案是不要在这里出现pin函数冲突,就好像您想要进行调试,并交替使用这些调试pin函数一样,调试将会中断,并且您的备用pin功能可能无法预测。总的来说,你的建议听起来是个馊主意。更详细地解释您的情况,并且可能获得更好的映射PIN功能的解决方案。

以上来自于百度翻译


      以下为原文

    You have failed to mention which ICSP pin set you are using (There are more than one set of ICSP pins that can be selected), nor have you mentioned which UART you are trying to use...  The best solution is to not have a pin function conflict here as if you want to debug and have these debug pins function alternately, debugging will be broken as well as your alternate pin functionality probably behaving unpredictably.  Overall, what you are suggesting sounds like a bad idea IMHO.  Explain your situation in better detail and possibly a better solution for mapping pin function can be attained. 
举报

王华

2019-6-6 11:26:34
当然,你是对的。闪烁:PIC32MX795F512H是在QFN64封装。我使用PGED1(引脚16)和PGEC1(15)作为ICSP引脚。我使用的UART是UART3(引脚上的U3RX 5,引脚6上的U3TX)。我选择这个UART是因为引脚5和6没有多路复用到它们的模拟功能,所以它们在复位后表现得像高Z。这个想法是,这个高Z将阻止引脚干扰ICSP过程。在芯片被编程之后,在UART3启用之前,RB0(PGED1)和RB1(PGEC1)被切换到._in(high-Z)。这一次防止ICSP引脚干扰UART3引脚。然而,UART通信不起作用。如果重新路由到不同的UART(UART1),一切正常。外部连接器有一个用于PGED1和U3RX的单个引脚。第二个引脚用于PGEC1/U3TX。我知道ICSP通过这个结构不可用。然而,调试设备不是盆装的,因此我可以使用不同的UART(UART1)来允许ICSP引脚在调试期间对ICD可用。UART数据的重新路由是通过代码中的“#ifdef_DEBUG”来处理的。我只有三个连接器插脚可用于外部世界:!MCLR、PGD和PGC。因此,我需要重新使用两个UARTRX/TX。

以上来自于百度翻译


      以下为原文

    You are right, of course. wink:
 
The PIC32MX795F512H is in a QFN64 package.
 
I am using PGED1 (pin 16) and PGEC1 (15) as ICSP-pins. The UART I am using is UART3 (U3RX on pin 5, U3TX on pin 6). I selected this UART because pins 5 and 6 have no analog functionality multiplexed to them, so they behave as high-Z after reset. The idea is that this high-Z will prevent the pins from messing with the ICSP-process. I can succesfully program the device.
 
After the chip has been programmed, RB0 (PGED1) and RB1 (PGEC1) are switched to digital_in (high-Z) before UART3 is enabled. This time to prevent the ICSP-pins to interfere with the UART3-pins. UART comms, however, do not work. If rerouted to a different UART (UART1), all is well.
 
The outside-world-connector has a single pin for PGED1 and U3RX. A second pin is used for PGEC1/U3TX.
 
I am aware of the unavailability of ICSP through this construct. Debug devices are, however, not potted and I can therefore use a different UART (UART1) to allow the ICSP-pins to be available to the ICD during debugging. This re-routing of UART-data is taken care of through "#ifdef _DEBUG" in the code.
 
I have no more than three connectorpins available into the outside world: !MCLR, PGD and PGC. I therefore need to re-use two of them as UART RX/TX.
举报

李天竹

2019-6-6 11:39:03
您可以将UART引脚连接到ICSP引脚。如果KeePuPin Pin高阻抗状态,它将不会干扰程序员。当程序员驱动MCLR低,您的PIC将重置,所有引脚走高阻抗。它可能值得测试,因为一些引脚可能在编程期间被驱动,这种情况非常罕见。然后,当您的PIC运行时,您将ICSP引脚置于高阻抗状态,以确保它们不会干扰UART。e(如果TX驱动得高,而程序员驱动得低)。当然,您不能同时运行UART和程序/调试。但是如果从一开始就不启用UART,并且保持UART管脚处于高阻抗状态,那么您仍然应该能够进行调试。

以上来自于百度翻译


      以下为原文

    You can connect the UART pins to ICSP pins. If you keep UART pins in high impedance state, it will not interfere with the programmer. When the programmer drives MCLR low, your PIC will reset and all pins go high impedance. It is probably worth testing because some of the pins may get driven during the programming - this is very uncommon by it happens.
 
Then, when your PIC runs, you'll put ICSP pins into high impedance state to make sure they don't interfere with UART.
 
You may want to put protective resistors on UART line (in case TX is driven high while the programmer drives it low).
 
Of course, you won't be able run UART and program/debug at the same time. But if you do not enable UART from the beginning and keep the UART pins in high impedance state you still should be able to debug.
举报

王华

2019-6-6 11:58:02
谢谢大家,你们的回答非常感谢。

以上来自于百度翻译


      以下为原文

    Thanks Guys, your replies are well appreciated.
举报

更多回帖

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