完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在使用汇编程序之后,我正在做我的第一个XC8项目,因为MPLAB代码配置器看起来不错。我有一个问题,就是在发送第一个字节后,TX引脚保持低电平,给了我灰色头发。它似乎已经消失后,我设置的LATC 6位,这是EASART的TX线,高。我可以发誓这个问题仍然在那里做了这件事,但它现在消失了,并留下LATC 6位低初始化不回来。有人知道是什么原因造成的吗?
以上来自于百度翻译 以下为原文 I'm doing my first XC8 project after using assembler because the MPlab code configurator looked good. I had a problem that was giving me grey hairs in that after the first byte was transmitted the TX pin remained low. It seems to have gone away after I set the LATC 6 bit, which is the EUSART Tx line, high. I could swear that the problem was still there after doing this but it's disappeared for now and leaving LATC 6 bit low on initialization doesn't bring it back. Does anyone know what could have caused this? |
|
相关推荐
5个回答
|
|
那么这可能是MPLAB代码配置器中的一个bug吗?我把EUSAT例程的创作留给了它。更糟糕的是不知道是什么原因造成的。这是一个自动售货机控制器的多点总线,我需要把TX线保持在低电平,以100Ms为总线重置。幸运的是它只在公共汽车上有一个音符读取器,我在后面,所以我可以不用总线重置。这也是我的第一个PPS PIC,我将检查PIN设置,但是在调试之前,如果我在EUSAT设置之前停止,并且在PIN设置之后,我仍然可以操纵RC6。可能与发送中断有关,代码配置器给出了两个选项TX1Stabest.sDeNB,当我遇到问题时,我最初将它设为0。现在它是1 -发送同步中断下一次传输(由硬件完成后完成)0 =同步中断传输禁用或完成
以上来自于百度翻译 以下为原文 Then this could be a bug in mplab code configurator? I left the creation of the eusart routine up to it. The worse thing is not knowing what caused it. This is multi drop bus for a vending machine controller and I'm required to hold the tx line low for > 100ms for a bus reset. Fortunately it only has a note reader on the bus and I'm behind so I can do without the bus reset. This is also my first pps pic, I'll examine the pin settings but under debug, if I stop before the eusart setup and after the pin setup I can still manipulate RC6. Maybe related to sending a break, code configurator gives two options TX1STAbits.SENDB, I initially had it as 0 when I had the problem and now it's 1 - Send Sync Break on next transmission (cleared by hardware upon completion) 0 = Sync Break transmission disabled or completed |
|
|
|
代码在HTTPS://Github. COM/Pulr/8ShanjvundC上。
以上来自于百度翻译 以下为原文 The code is at https://github.com/plater/8_chan_vend_C |
|
|
|
一般来说,这就是MCC的问题。并不是说MCC本身就是(坏的),而是帮助某人从MCC调试东西需要超越我目前精神发展状态的精神力量。换句话说,我不知道,不知道,不知道如何找出(在合理的迭代次数)它是否是MCC中的一个“bug”。即使我可以看着你的肩膀,因为你在配置野兽。我听到了!最糟糕的是当一些东西神奇地“修复”自己。在将来的某一天,它有一种“解脱”的方式。(可能是在向顾客演示时。我想我会怎么做的,假设UART已经为UART TX引脚初始化了一个有效的PPS分配,UART处于空闲状态。不要弄乱所谓的“中断”信号。这不会帮助你的。我的序列为总线复位:设置的LAT位为UART的TX引脚低。设置TIS位的UART TX引脚低。设置PSOR寄存器的UART TX引脚为零。这个UN分配PPS并让LAT位驱动Tx输出引脚低。安排,不知何故,延迟100毫秒。在所需的延迟时间之后,设置LAT位高,也许,等待几毫秒以确保UART TX引脚保持在其空闲状态。(Delay在下一步之前可能是不必要的,但是我无论如何都在启动初始化中这样做,所以在这里再次做起来很方便。)注意,你不必改变TIS;你可以把它放低。重新分配UART TX引脚的PPSOR寄存器到UART TX信号。RAM,问候,戴夫
以上来自于百度翻译 以下为原文 Well, generally speaking, that's the problem with MCC. Not that MCC is (necessarily) bad in itself, but helping someone debug stuff from MCC requires psychic powers beyond my present state of spiritual development. In other words, I don't know, can't know, don't know how to find out (in a reasonable number of iterations) whether it's a "bug" in MCC. Not even if I could look over your shoulder as you are configuring the beast. I hear you! The worst thing is when something magically "fixes" itself. It has a way of "unfixing" itself at some future date. (Probably during a demonstration to a customer. Or possibly worse than that, to my boss's boss.) Here's how I would do it, assuming the UART has been initialized with a valid PPS assignment for the UART Tx pin and the UART is in the idle state. Don't mess with the so-called "break" signal. It won't (can't) help you here. Fuggedaboudit. My sequence for a bus reset:
Regards, Dave |
|
|
|
相关的部分是:Rx1ppsBist.RxPPS= 0x17;/rCp7:Rx1;RC6PPS= 0x09;//RC6-和;EUTART1:TX1;RB5PPS= 0x0b;//RB5--Gt;EuSART2: TX2;RX2PPSITS.RXPPS= 0x0C;//RB4--Gt;EuSART2: RX2;PPSROCK=0x55;PPSROCK=0xAA;PPSLOCKbits.PPSLOCK。我查看了MCC的PixMealthC.C。ED= 0x01;//锁定PPP不理解为什么RC6在EUSAT初始化之前工作,因为它看起来像是在这个例程中被锁定到EUSATAR1: TX1。不管怎样,我的MOTO也是“如果它没有坏,不要修理它”谢谢你的帮助。
以上来自于百度翻译 以下为原文 I looked through MCC's generated pin_manager.c and the relevant section is: RX1PPSbits.RXPPS = 0x17; //RC7->EUSART1:RX1; RC6PPS = 0x09; //RC6->EUSART1:TX1; RB5PPS = 0x0B; //RB5->EUSART2:TX2; RX2PPSbits.RXPPS = 0x0C; //RB4->EUSART2:RX2; PPSLOCK = 0x55; PPSLOCK = 0xAA; PPSLOCKbits.PPSLOCKED = 0x01; // lock PPS Can't understand why RC6 works before the eusart is initialized because it looks like it's locked to EUSART1:TX1 in this routine. Anyway my moto is also "if it ain't broke don't fix it" Thanks for your help. |
|
|
|
如果你使用PPS和XC8,请阅读下面的链接。
以上来自于百度翻译 以下为原文 If you use PPS and XC8, please read below link. http://www.microchip.com/forums/m1040889.aspx |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3209 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2260 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 11:48 , Processed in 1.497349 second(s), Total 85, Slave 69 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号