完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,不确定这是蓝牙问题还是UART?我在原板上有一个RN467 8,在板上还有一个16F1779和一个FTDI 232芯片。我想通过UART配置RN,我的所有开发都是通过我的手机上的实用型和蓝牙应用来完成的。我可以从PIC发送数据到手机上没有问题。接收数据是问题所在!UART是115200波特,作为标准,PIC从iToSC中运行在32兆赫。我可以通过FTDI芯片@ 115200与PIC对话,当我在试图从RN467 8接收字节时检查帧错误位,它被设置为溢出位。我已经尝试读取RC1RG并重置UART,是因为错误率稍微降低了帧错误吗?我用PPS模块把UART从一对引脚移到另一个,如果我删除RN467和连接TX RX I可以回传到真实的术语,所以我知道这是有效的!任何帮助都欣然接受!欢呼杰夫
以上来自于百度翻译 以下为原文 Hi all, Not sure if this is a Bluetooth issue or UART ?! I have a rn4678 on a proto board I've made, also on the board are a 16f1779 and a ftdi 232 chip. I would like to configure the rn via UART, all my development has been done via real term and a Bluetooth app on my phone. I can send data to the phone from the pic no problem. Receiving data is where the issue lies! The UART is 115200 baud as standard, pic is running at 32mhz from the int osc. I can talk to the pic via the ftdi chip @ 115200, when I check the framing error bit when trying to receive a byte from the rn4678 it is set as is the overrun bit. I've tried reading rc1reg and resetting the UART. Is the framing error because the baudrate is slightly out? I'm using the pps module to 'move' the UART from one pair of pins to another, if I remove the rn4678 and connect tx-rx I can echo back to real term so I know that works ! Any help gladly received! Cheers Geoff |
|
相关推荐
19个回答
|
|
|
嗨,我检查了PIC16F1779数据表。它的内部振荡器从0到60C具有+/- 2%频率容差。如果你的应用程序必须在这个范围之外工作,那么XTAL是强制性的(参见图115200的频率精度图33-6。你能得到准确的115200波特率还是有误差?在UART上似乎有一个影响硅Rev A0的勘误表。你检查过这是否会影响到你?有一个解决方案被提出来解决这个问题。检查使用MPLAX X,你通过连接你的板和启动调试模式。在BigigRIM中,消息将在输出窗口中告诉您修订级别。http://WW1.Microchip .com /…勘误表%20800 0666B.PDFNB:您使用最新的RN467 8固件(V1.11)吗?如果不一定要更新你的模块:http://WW1.Microchip .com……2217.RelaseE.NOT.PDFE,然后确保订购RN467 8V/RM111(这意味着固件V1.11)。
以上来自于百度翻译 以下为原文 Hi, I checked the PIC16F1779 datasheet. Its internal oscillator has a +/-2% frequency tolerance from 0 to 60C. If your application must operate outside this range, then a XTAL is mandatory (see frequency precision against temperature graph figure 36-6. When you program 115200 bauds into the UART prescaler, do your get the exact 115200 baudrate or you have some error ? There seems to be an errata on the UART which affects silicon rev A0. Did you check if this might affect you ? There is a workaround proposed to solve this issue. check using MPLAB X which revision you have by connecting your board and launching debug mode. At the beigining a message will tell you in the output window the revision level. http://ww1.microchip.com/...Errata%2080000676B.pdf NB : Do you use the latest RN4678 firmware ( v1.11) ? If not make sure to update your module : http://ww1.microchip.com/...2217_release_notes.pdf Then make sure to order RN4678-V/RM111 (it means firmware v1.11) Regards |
|
|
|
|
|
嗨,谢谢你的快速回复,我检查了勘误表,这个问题是在UTT的TX侧,所以这次不会影响到我!我应该说,我在读取接收标志之前,正在阅读Orr和Frr位,没有设置接收标志?PIC可以TX>RN467 8,但没有收到它?波特率误差会给我这个问题吗?PIC可以通过FTI芯片与我的PIC进行通信,这两种方式都没有问题。我有1.10版本,我想当它被焊接到电路板上时,它可能是更新的窍门。如果我把这个卖出去,我真的不想更新每一个。我以前从来没有遇到过UART的问题,所以在大多数项目中都没有读过错误标记。我可以只使用RN468,我只需要一个方法,但是看起来很草率,我想在第一次上电时重命名它,需要改变一些设置。Cheers Geoff
以上来自于百度翻译 以下为原文 Hi, Thanks for the quick reply, I did check the errata and the issue is on the tx side of the UART so isn't affecting me this time! I should have said, I'm reading the oerr and ferr bits before I poll the receive flag, the receive flag isn't being set? The pic can tx > rn4678 but not receive from it? Would a baud rate error give me this problem? The pic can communicate with my pic via the ftdi chip no problem both ways. I have version 1.10 I think as it is soldered to the board it might be trick to update? If I make this for sale I don't really want to have to update each one?! I've never had much trouble with UART before so haven't been reading the error flags in most projects. I could just use the rn4678 as it is, I only really need one way comms but that seems sloppy and I would like to rename it on first power up and need to change some settings. Cheers Geoff |
|
|
|
|
|
你用的是什么针?如果它们是模拟能力的,你把它们转换成数字模式了吗?(我怀疑不是,好像它是在模拟模式下,它总是读为零,这会导致连续的错误,就像你看到的一样。)
以上来自于百度翻译 以下为原文 Which exact pins are you using? If they are analog capable, have you switched them to digital mode? (I suspect not, as if it's in analog mode, it will read as always zero, which would cause continual OERR errors, just what you are seeing.) |
|
|
|
|
|
谢谢,他们是在数字模式,如果我连接TX RX的蓝牙应该是我得到回音,即PIC自言自语,所以我知道它可以接收,我仍然不知道问题在哪里,PIC或RN467 8?如果存在溢出或帧错误,是否应该设置接收标志?我在引脚之间翻转Rx,这会产生错误吗?欢呼杰夫
以上来自于百度翻译 以下为原文 Thanks, they are in digital mode, if I connect tx-rx where the Bluetooth should be I get a echo back, ie pic talking to itself, so I know it can receive, I'm still not sure where the issue is, pic or rn4678? Should the receive flag be set if there is a overrun or framing error? I am flipping RX between pins , could this generate the error? Cheers Geoff |
|
|
|
|
|
一个溢出错误应该设置RCIF.FER,只是说如果接收到的最后一个字节有帧错误。在接收到另一个字节之前,它不会更新。当你交换此错误时,两个信号都必须是空闲的(=高)。如果你发布了你的代码,我们就可以观察到你的切换是否正常。
以上来自于百度翻译 以下为原文 An overrun error should set RCIF. FERR just says if the last byte received had a framing error. It doesn't update until you receive another byte. Both signals would have to be idle (=high) when you swapped for this to happen error free. If you posted your code, we might be able to observe if your switching is ok. |
|
|
|
|
|
进一步考虑,我不知道UART RX在切换PIN时会看到什么。可能有一个尖峰到零,所以在改变PIN赋值时,应该清除CREN。
以上来自于百度翻译 以下为原文 Thinking further, I don't know what the UART RX will see as you switch the pin. There could be a spike to zero, so you should clear CREN while you are changing the pin assignment. |
|
|
|
|
|
谢谢,我想知道我是否应该禁用这个模块,当我回到我的电脑上时,它会发出一个信号,也会发布我的代码。Cheers Geoff
以上来自于百度翻译 以下为原文 Thanks, I had wondered if I should disable the module, will give that a go when I get back to my computer, will post my code too. Cheers Geoff |
|
|
|
|
|
嗨,尝试禁用UART仍然没有欢乐。这是我的PIN更改代码;BlueGyReVEY;在WangBooSL RC1STA BCF RC1STA,CREN中返回一个字节;禁用UART BANSEL RC2PPS MOVLW B’0101000’;TX MOVWF RC2PPS;在RC2上,蓝牙模块CRF RC3PPS BANSEL RXPPS MOVLW B’000 010011’;RX在RC3 MOVWF RXPPS BANSEL RC1STA BSF RC1STA,CRE上。N;使接收银行晚点BCF晚,1;请求发送RS4BCL低BANSSEL PIR1 BTFSS PIR1,RCIF;等待数据GOTO $-1BANSEL LATC BSF迟,1;暂停RN 4678银行RXPPS MOVLW B’000 010100’MOVWF RXPPS;将RC4设置为来自FTDI芯片BACSEL RC5PPS MOVLW B '00 100100'的RX;TX MOVWF;RC5PPS;在RC5,BANSEL RC1RG MOVF RC1RG,W;收到数据返回希望不显得凌乱,如何添加代码标签?就像我之前说过的,我仍然不确定问题在哪里,Re1连接到RN467 8 CTS,所以理论上什么都不应该被发送,直到它被拉低,它在Cheers Geoff的开始时设置得很高。
以上来自于百度翻译 以下为原文 Hi, Tried disabling UART still no joy. Here is my pin changing code; BLUE_RECIVE ;RETURNS A BYTE FROM BLUETOOTH IN W BANKSEL RC1STA BCF RC1STA,CREN ;DISABLE UART BANKSEL RC2PPS MOVLW B'00101000' ;TX MOVWF RC2PPS ;ON RC2, BLUETOOTH MODULE CLRF RC3PPS BANKSEL RXPPS MOVLW B'00010011' ;RX ON RC3 MOVWF RXPPS BANKSEL RC1STA BSF RC1STA,CREN ;ENABLE RECEPTION BANKSEL LATE BCF LATE,1 ;REQUEST TO SEND FROM RN4678,PULL CTS LOW BANKSEL PIR1 btfss PIR1,RCIF ;WAIT FOR DATA GOTO $-1 BANKSEL LATC BSF LATE,1 ;PAUSE RN 4678 BANKSEL RXPPS MOVLW B'00010100' MOVWF RXPPS ;SETS RC4 AS RX FROM FTDI CHIP BANKSEL RC5PPS MOVLW B'00100100' ;TX MOVWF RC5PPS ;ON RC5, BANKSEL RC1REG movf RC1REG,W ;get received data return Hope that doesn't look messy, how do you add code tags? Like i said earlier I'm still not sure where the issue lies, RE1 is connected to rn4678 cts, so in theory nothing should be sent until its pulled low, it is set high at the start of the main. Cheers Geoff |
|
|
|
|
|
您不禁用CREN,同时将RX引脚切换回FTDI芯片。只需在代码之前放置{Code }和{/code },但使用[]而不是{}。
以上来自于百度翻译 以下为原文 You're not disabling CREN while switching the RX pin back to the FTDI chip. Just put {code} before, and {/code} after the code, but using [] instead of {} Like this example code |
|
|
|
|
|
嗨,你说得对,现在已经整理好了,仍然没有欢乐!目前它似乎收到一个字节,然后溢出?当我使用流量控制时,我看不出为什么会这样。我期待它能收到%连接%,当我连接电话和回声回电话,PIC是做32兆赫,所以应该有足够的时间与大约20-30行之间运行的字节,即使他们不断出现。欢呼杰夫
以上来自于百度翻译 以下为原文 Hi, You're quite right, have sorted that now, still no joy! At the moment it seems to receive one byte, then overrun? As I'm using flow control I can't see why this would be? I'm expecting it to receive %CONNECTED% when I connect the phone and echo this back to the phone, the pic is doing 32mhz so should be plenty of time with about 20-30 lines to run between bytes even if they kept coming? Cheers Geoff |
|
|
|
|
|
流量控制通常不是即时的,一个或两个以上字节可能会在你把它弄错之后。
以上来自于百度翻译 以下为原文 Flow control often is not instant, one or two more bytes may come after you make it false. You might be better off receiving a whole line into RAM, before switching pins. |
|
|
|
|
|
您好,你们有RN-467—PICTWER板吗?这个板使用MC2200 USB & lt;=& gt;UART桥,因此它应该与FT32一样容易地工作。检查THEN-467—PICTWER用户手册,因为它显示了示意图并与您的比较:HTTP:/WW1.MICCHIP.COM/DUNDIPS/En/DeVICECD/OC0252566 A.PDFRIGARDS
以上来自于百度翻译 以下为原文 Hi, Do you have a RN-4678-PICTAIL board ? This board uses MCP2200 USB <=> UART bridge so it should work as easily with FT232. Check the RN-4678-PICTAIL user manual as it shows the schematic and compare with yours : http://ww1.microchip.com/downloads/en/DeviceDoc/50002566A.pdf Regards |
|
|
|
|
|
谢谢,所以如果我做一个最长预期行的缓冲区,那应该能让我摆脱麻烦,我假设流量控制是即时的,假设是所有$%@μUPS的母亲:-)当我回到电脑后再试试。
以上来自于百度翻译 以下为原文 Thanks, so if I make a buffer of the longest expected line, that should get me out of trouble, I had assumed flow control would be instant , assumption is the mother of all $%@# ups :-). Will try later when I get back to computer. Cheers Geoff |
|
|
|
|
|
更新,我清理了我的代码并添加了一个43字节的缓冲器(我有一个测试板,我用一个MCP UART桥和另一个RN467 8,所以我的代码看到第一个传输和它的43个字节)。缓冲器被填满了,但没有任何有意义的……来澄清我所拥有的是一个16F1779机智。一个FTI芯片从PC上用两个引脚交谈。它也有两个其他引脚的RN467 8,内部OSC@ 32 MHz。PC & LT;& P.C.C.工作良好,PIC&GT;RN467 8工作良好,但RN468&GT;PIC不是,无意义接收。如果我取出RN467和加入TX RX,它的回声,所以我知道UART工作在那些引脚。我想把一个晶体。为了得到更准确的波特率,但FTTI的工作会有什么帮助吗?RN467 8一次发送所有43个字节,这是否需要更精确的定时?欢呼杰夫
以上来自于百度翻译 以下为原文 Update, I've cleaned up my code and added a 43 byte buffer (I have a test board I made up with a MCP uart bridge and another rn4678 so I code see the first transmission and its 43 bytes). The buffer is being filled but not with anything that makes sense... Just to clarify what I have is a 16f1779 with a ftdi chip talking to it from PC on two pins. It also has the rn4678 on two other pins, internal osc @ 32Mhz. The PC <> pic comms works fine, pic > rn4678 works fine but rn4678>pic isn't, nonsense is received. If I take out the rn4678 and join tx-rx it echo's so I know the UART works on those pins. I'm thinking of putting on a crystal to get a more accurate baud rate but as the ftdi works will this be any help? The rn4678 does send all 43 bytes in one go, could this need more accurate timing? Cheers Geoff |
|
|
|
|
|
每次读取RX寄存器之前清除溢出位。
以上来自于百度翻译 以下为原文 clear the overrun bit before reading rx register every time. |
|
|
|
|
|
谢谢,所以重置UART(清除SPON或CREN?)在阅读RC1RG之前?只是问,因为我不知道!16F1779上的ORR位是只读的。每次接收字节时,仍会设置RCIF,即使已经超限了吗?欢呼杰夫
以上来自于百度翻译 以下为原文 Thanks, So reset the UART (clear spen or cren?) Before reading rc1reg? Only ask as I don't know! The oerr bit on 16f1779 is read only. Will rcif still be set each time a byte is received even if the has been a overrun? Cheers Geoff |
|
|
|
|
|
这并不重要,因为UART在每一个起始位上都是RISYCHS。清除ORR的唯一方法是切换CREN OFF。(切换SPEN也会这样做,但是这不是一个好方法,因为它会从USAT中释放TX和RX引脚,可能在TX上引起一个小故障)。l您切换CRE.RCIF将保持设置,直到您执行RCREG的两个虚拟读取以清空接收缓冲器。参见:“数据33-5异步接收”在数据表中。
以上来自于百度翻译 以下为原文 That shouldn't matter, as the USART resynchs on every START bit. The only way to clear OERR is to toggle CREN off then on. (Toggling SPEN would do it too, but that is not good way, as it will release the TX and RX pins from the USART, probably causing a glitch on TX.) No. The receiver is disabled until you toggle CREN. RCIF will stay set until you do the two dummy reads of RCREG to empty the receive buffer. See: "Figure 33-5 ASYNCHRONOUS RECEPTION" in the datasheet. |
|
|
|
|
|
谢谢,一直在瞎扯,我想这可能是流量控制问题吧?我断开了RN468TX,所以我可以在没有PIC RX连接的情况下对它进行调整。在我的“开发”板上,我把CTS接地,因为我只想通过终端来播放设置。我可以清楚地看到RN467 8TX上的输出。如果我在问题板上加电后设置CTS低电平,我得到了范围内的TX输出,我是否误解了流量控制功能。NS?RN467 8上是否有溢出缓冲区?当我的RX例程设置CTS低时,有43个字节来自RN467,它们永远不会到达,除非CTS从一开始就低了。我正在监视P1Y5,看看模块是什么时候连接的,然后在我知道它连接的时候拉低CTS。我要做一个中断驱动的RX例程,但是想知道流量控制是否会像我认为的那样工作。谢谢杰夫
以上来自于百度翻译 以下为原文 Thanks, Have been fiddling around with this, I think it maybe a flow control issue? I disconnected the rn4678 tx so I could scope it without the pic RX connected. No output. On my 'development' board I grounded CTS as I just wanted to play around with settings via terminal. I can clearly see the output I expect on rn4678 tx. If I set CTS low just after power up on the problem board I get the tx output on the scope, am I misunderstanding how flow control functions? Could there be a overrun buffer on the rn4678? By the time my RX routine set CTS low there are 43 bytes to come from the rn4678, they never arrive unless CTS has been low from the start? I'm monitoring p1_5 to see when the module is connected then pulling CTS low when I know its connected. I'm going to do a interrupt driven RX routine but would like to know if flow control will work as I think it should? Thanks Geoff |
|
|
|
|
|
嗨,你有没有RN-467 8 PICTALTO做一些测试?它使用了一个MC2200网桥,如果你把它连接到一台PC上,它就可以从盒子里出来。我多次使用它,包括将PICTHEL插入到ExpReal16或ExpReal8 Boad Skek中。它在用户手册中显示。对于PIC软件,你可以使用RN467 7的应用笔记,因为它与RN467的设备几乎相同(AN2244和AN2255)。它展示了如何与PIC互连TN467 7(RN467)。
以上来自于百度翻译 以下为原文 Hi, Do you have a RN-4678-PICTAIL to do some tests ? It uses a MCP2200 bridge and works out of the box if you connect it to a PC. I used it several times, including pluging the PICTAIL into the EXPLORER16 or EXPLORER8 boards Check the PICTAIL schematic against yours. It is shown in the user manual. Regarding PIC software, you can use the RN4677 application notes as it is almost the same device as RN4678. (AN2244 and AN2255). It shows how to interconnect TN4677 (RN4678) with a PIC. Regards |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1097浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 08:36 , Processed in 1.149426 second(s), Total 110, Slave 93 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1696