Microchip
直播中

王洋

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

如何在PIC18中使用EUSART

嗨,我是PIC18新手,遇到麻烦了。我可以用PIC16F1829和其他的USAART而没有问题,但是自从我开始使用PIC18,我就不能使用EUSAT了。事实上,我甚至不能让LATCX高或低!MCLR似乎根本没有复位。我肯定错过一些东西,但找不到几个小时!这就是我所做的。使新项目[微芯片嵌入] [Pic18F13K22]支持调试头[NON] [PKIT3] [Sn:Bur09000] [编译器工具链] [XC8(V1.42)]项目PIC18F13K22。打开CONFIG[CONF]—[PICtiT3] - [电源] [来自PICTIT3]的电源目标威廉希尔官方网站 检查电压3.0按[MCC] [内部时钟] [16MHZH-HFIFTSOC]增加[ Esurt ]添加检查[使能发送],[启用连续接收],[重定向STDIO到USAT ]打开Maun.CF LATC,打开Maun.C,并编辑这样的代码。

以上来自于百度翻译


      以下为原文

    Hi,
I’m new to PIC18 and in trouble with it. I could use EUSART with PIC16F1829 and others without problem but since I started to use PIC18 I can’t use EUSART. Actually I can’t even let LATCx HIGH or LOW! MCLR doesn't seem to reset at all. I'm definitely missing something but can't find it for hours!

This is what I did.
Make New Project
[Microchip Embedded]-[Standard Project]
Device [PIC18F13K22]
Supported Debug Header [None]
[PICkit3]-[SN:BUR000000000]
[Compiler Toolchains] - [XC8 (v1.42)]
Project PIC18F13K22 is made.

Open Config
[Conf]-[PICkit3]-[Power]
[Power target circuit from PICkit3] Check
Voltage Level 3.0

Press [MCC]
[Internal Clock] [16MHz_HFINTOSC]
added [ESURT]
Add Check to [Enable Transmit], [Enable Continuous Receive], [Redirect STDIO to USART]

Open main.c
    while (1)
    {
        // Add your application code
        printf("testn");
    }


For LATC, open main.c and edited the code like this.
    while (1)
    {
        // Add your application code
        printf("testn");
        LATC6 = HIGH;
        LATC6 = LOW;
    }


I'm using:
Windows10
MPLABXIDE v3.65
XC8 (v1.42)
MCC v3.36
PIC18F13K22, PIC18F14K22

Thank you,
Daniel. K   Attached Image(s)


Attachment(s)

PIC18F13K22.zip (23.44 KB) - downloaded 37 times

回帖(13)

王焕树

2019-1-18 18:45:11
我只专注于切换PIN。你把PIN C6设置为输出吗?

以上来自于百度翻译


      以下为原文

    I'd just concentrate on toggling the pin first.
Have you set pin C6 to be an output?
 
 
举报

贾飞小

2019-1-18 18:53:43
你是如何配置你的PIN管理器的?你是模拟还是硬件?

以上来自于百度翻译


      以下为原文

    How did you configure your pin manager.
Are you simulating or hardware?
举报

王竹

2019-1-18 19:01:05
模拟项目-GT;C6是输入@丹尼尔:包装一个项目没有很多无用的临时材料-gt;http://MyCHIPPrdult.COM/MPLABX:项目包(23.2KB而不是19KB)

以上来自于百度翻译


      以下为原文

   
Simulating the project -> C6 is input
 
@Daniel:
Packing a project without a lot of useless temporary stuff
-> http://microchipdeveloper.com/mplabx:projects-package (23.2kB instead of 190kB)
举报

h1654155275.5627

2019-1-18 19:20:17
嗨,伙计们,非常感谢你们的帮助!我检查了PIN管理器,但是我找不到可疑的东西。我上传了最新的软件包(感谢VLogi!)以及PIN管理器的屏幕截图和电压检查。(我用硬件,卡特拉)谢谢你,丹尼尔。K

以上来自于百度翻译


      以下为原文

    Hi Guys,
Thank you so much for your help! I checked the pin manager but I couldn't find anything suspicious.
I uploaded the newest package (thanks to vloki!) and screen shots of pin manager and the voltage inspection. (I'm using hardware, katela)
Thank you,
Daniel. K
 
 
举报

更多回帖

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