完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛扫一扫,分享给好友
|
您好,我是新型蜂嵌入式系统。我正在获取符号作为UART传输的输出。我已经使用了8MHz的晶体和高速波特率设置。使用的工具是MPLAB X IDE V3.0,编译器是XC8。下面是代码和输出图像。
以上来自于百度翻译 以下为原文 Hello, I am new bee to embedded system. I am getting symbols as an output for uart transmission. I have used 8MHz crystal and high speed baud rate is set. Tool used is MPLAB X IDE v3.0 and compiler is XC8. Below is the code and output image. Any suggestions would be appreciated. Attached Image(s) Attachment(s) uart.c (3.18 KB) - downloaded 19 times |
|
相关推荐
4个回答
|
|
|
你确定你的晶体是8MHz吗?你有示波器检查频率吗?还要注意的是,在这里,你的代码与你的注释0x40设置的6位到1位和7位到0位的相反。不必担心TrISC6错误,因为USAT无论如何都会迫使这个PIN为输出,但是清除TrISC7意味着您将无法接收。
以上来自于百度翻译 以下为原文 Are you sure your crystal is 8MHz? Do you have an oscilloscope to check the frequency? Also note, here your code does the opposite of your comments //****Setting I/O pins for UART****// // TRISC6 = 0; // TX Pin set as output // TRISC7 = 1; // RX Pin set as input TRISC=0x40; 0x40 sets bit 6 to 1 and bit 7 to 0! It doesn't matter that you got TRISC6 wrong, as the USART forces this pin to be an output anyway, but clearing TRISC7 means you will not be able to receive. |
|
|
|
|
|
你好,Qub,我也试着改变TrISC PIN,但是当我改变它的时候,我一点都没有得到输出。我已经使用了8MHz晶体。如何检查振荡器输出,是否有引脚检查??
以上来自于百度翻译 以下为原文 Hello qub, I have also tried changing TRISC pin, but when I change this I didn't get the output at all. I have used 8MHz crystal. How to check the oscillator output, are there any pins to check?? |
|
|
|
|
|
你改变了什么,改变了什么?10:1范围的探头应该能够测量OSC2/CKO PIN。如果你修改你的代码,只需继续传输字符‘u’(它有一个0x55的十六进制值),你就可以看到在TX引脚上波特率的一半的方波。
以上来自于百度翻译 以下为原文 What did you change, and to what? A 10:1 scope probe should be able to measure the OSC2/CLKO pin. If you modify your code to just keep transmitting character 'U' (which has a hex value of 0x55) you should see a square wave at half the baud rate on the TX pin. |
|
|
|
|
|
我已经改变了TISISC引脚正如你提到的。我无法发送或接收。我还测量了晶体中的8MHz正弦波频率。然后我改变了微控制器。倾倒相同的代码现在它工作正常。问题解决了。我认为硬件侧的控制器引脚可能有问题…
以上来自于百度翻译 以下为原文 I have changed the TRISC pins as you have mentioned. I was unable to transmit or receive. I have also measured the frequency its 8MHz sine wave at crystal. Then I have changed the micro controller. dumped the same code now it works just fine. the problem is resolved. I think there might be issue with the controller pins on hardware side... |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 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 05:30 , Processed in 0.655227 second(s), Total 83, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
5453