完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,伙计们,我正在与PIC16LF1709作斗争,我在端口引脚RA3上映射了USART RX,这是/MCLR输入。在配置字中,我定义MCLR作为数字输入。在固件中,我将RA3上的上拉设置为活动的,并且RA3映射为RX输入:我可以通过TX发送字符,但是接收不是一个选项。但是当我在RX上映射RA4:字符确实进来了。所以我怀疑数据表中有一个缺陷。RA3不能用于PPS吗?PPS1WAY是ON,但是PPSLOCKED从未设置(在上面发布的initSerialPort()函数中只清除一次)。我想在RA3上映射RX的原因是,我使用programheader作为串行端口的连接器,由我编写的引导加载程序使用(在MCLR管脚1(RA3)上的RX和ICSPD管脚4(RA0)上的TX)。有什么建议吗?谢谢你的帮助
以上来自于百度翻译 以下为原文 Hi Guys, I'm struggling with a PIC16LF1709 where I mapped the USART RX on portpin RA3, which is the /MCLR input. In the config words I define MCLR as a digital input. In the firmware I make the pullup on RA3 active and is RA3 mapped as RX input: void initSerialPort(void) { PPSLOCK=0x55; PPSLOCK=0xAA; PPSLOCKbits.PPSLOCKED = false; RXPPS = 0b00000011; // = Peripheral input is RA3 RA0PPS = 0b00010100; // RA0 source is TX/CK BAUD1CON = 0x08; // BRG16=1 SPBRG = 138; // 57K6 TRISA0 = 0; TX1STA = 0b00100100; // TX enabled, highspeed (BRGH=1) RC1STA = 0b10010000; // RX enabled: SPEN=1, CREN=1 RC1REG; } I can send characters through TX, but receiving is not an option. But when I map RA4 on RX: RXPPS = 0b00000100; // = Peripheral input is RA4 characters do come in. So I suspect a flaw in the datasheet. RA3 cannot be used for PPS ?? PPS1WAY is ON, but PPSLOCKED is never set (only cleared once in the function initSerialPort() posted above). The reason why I want to map RX on RA3 is, that I use the programheader as a connector for a serial port, used by the bootloader I wrote (RX on MCLR pin 1 (RA3) and TX on ICSPD pin 4 (RA0)). Any suggestions ? Thanks in advance Reini |
|
相关推荐
8个回答
|
|
不要忘记MCLR是一个非常特殊的引脚,这意味着它有一些特殊的硬件,因为它在“复位芯片”和“编程芯片”这两个功能上都是附加的。我不确定它是否可以用于EuSAT公文。只要我的2分钱…最好。
以上来自于百度翻译 以下为原文 Hi Don't forget that MCLR is a very special pin, meaning it has some special hardware attached due to its functinality in both "reseting the chip" and "programming the chip". I'm not sure it can be used for EUSART comms. Just my 2 cents.... Best regards Jorge |
|
|
|
嗨,Jorge,我当然知道,但是在1709数据表或TB3130(PPS技术简介)中没有提到我不能在RA3中映射RX。甚至MPLABX的代码生成器也允许使用它(当RESET被清除时,正是我手动执行的操作)。
以上来自于百度翻译 以下为原文 Hi Jorge, Of course I'm aware of that, but nowhere in the 1709 datasheet, or in TB3130 (PPS technical brief) is mentioned that I can't map RX in RA3. Even the code generator of MPLABX allows it (when RESET is cleared, just what I did manually). Thanks for your input though :-) Kind regards, Reini |
|
|
|
很不幸,数据表中有很多东西说得不是100%正确。MCC、Harmony、……生成的代码也是这样。这个foruns中存在大量的线程,正因为如此。如果您想使用ICSP头进行串行通信,可以吗?您尝试使用ICSPLK(PGC)和ICSPDAT(PGD)吗?只是一个想法……最好
以上来自于百度翻译 以下为原文 Hi Unfortunatelly, there is a lot of stuff that the datasheets say and don't say that is not 100% correct. The same can be said from the code generated by MCC, Harmony, ..... A huge number of threads in this foruns exist just because of that. If you want to use the ICSP header for serial comms, may I suggest, you try to use ICSPCLK (PGC) and ICSPDAT (PGD) for that? Just an idea... Best regards Jorge |
|
|
|
…不要试图在调试模式中使用这些引脚(PGD、PGC、MCLR)。只是另一个想法;
以上来自于百度翻译 以下为原文 ... and don't try to use any of those pins (PGD, PGC, /MCLR) in debug mode. just another idea ;-) |
|
|
|
嗨,是的。当使用ICSP管脚实现任何特定于项目的功能时,调试都是不可能的,至少要调试完整的发布代码。我通常做的是测试和调试我的程序,分段进行,每次测试和调试每个功能,使用条件编译(ifdef)来隔离部分代码的完整构建。一般来说,完全构建只发生在接近项目完成的地方。但是,是我,其他人,最肯定地,按照自己的方式完成。
以上来自于百度翻译 以下为原文 Hi Yes. When one uses the ICSP pins for any project specific functionality, debugging can be impossible, at least debugging the full release code. What I usualy do is to test and debug my programs in separate pieces, each functionality at a time, using conditional compiling (#ifdef) to isolate sections of the code. A full build only occurs, generaly, very close to the finish of the project. But that its me, others, most certainly, do it their own way. Best regards Jorge |
|
|
|
这也是一个好主意,过去做了几次。
以上来自于百度翻译 以下为原文 This is also a good idea, done some times in the past |
|
|
|
嗨,Jorge,你的建议很好,如果我还没有连接ICSPD作为eeprom的芯片选择,我想用引导加载程序来编程:-)所以,这留给我MCLR和ICSPC嗅觉再次感谢!亲切的问候,Reini
以上来自于百度翻译 以下为原文 Hi Jorge, Your suggestion is fine, if I did'nt already connect ICSPD as a chip select for an eeprom, which I want to program with the bootloader :-) So, that leaves me with MCLR and ICSPC snif Thanks again! Kind regards, Reini |
|
|
|
大家好:-)我的目标总是把选项推到极限,所以如果一个选定的芯片有14个IO,我会使用它们最肯定的所有哈哈。当您将PGD和PCC管脚用于除编程和调试之外的其他目的时,调试确实很困难。但是我主要实现某种类型的串行端口(在嵌入有defines的代码中,这样我就可以在没有串行端口的情况下发布固件)。我想我会重新考虑在引导加载器中使用串行端口。没有它,我可以在不到0x180字节内装入引导加载程序(它从外部eeprom编程芯片,它可以从应用程序编程)。我只能从应用程序中编程EEPROM。引导加载程序只能对eeprom中的PIC闪存进行编程。
以上来自于百度翻译 以下为原文 Hi all :-) My goal is always to push the options to the limit, so if a selected chip has 14 IO's I will use them most certainly all haha. Debugging is indeed difficult when you use the PGD and PGC pins for other purposess as well other than for programming and debugging. But I mostly implement a serial port of some kind (in code embedded with defines, so I can release the firmware without the serial port). I think I will reconsider using the serial port in the bootloader. Without it, I can fit a bootloader in less than 0x180 bytes (it programs the chip from an extern eeprom, which can be programmed from the application). My option was to program the external eeprom through the bootloader and serial port from a PC application, but I'll let that rest and go for the option that I can only program the eeprom from the application. The bootloader can only program the PIC flash from eeprom. So, case closed :-) Thanks to all for your input With kind regards, Reini |
|
|
|
只有小组成员才能发言,加入小组>>
5159 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2223 浏览 5 评论
724浏览 1评论
610浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
499浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
623浏览 0评论
522浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-20 11:23 , Processed in 1.373891 second(s), Total 92, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号