完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我正在做一个太阳能LED /充电器的设计,在1467年,我将项目文件导入MPLAB V3.51,并告诉它使用XC8 V1.33编译器。它很好地编译成功,但是有两个在MIN .CI中被列出为错误的Yang-COFIG语句,意识到C18使用这些语句来设置配置位,并且我应该将这些更改为PrimMA语句,但我的问题是,我如何破译旧的设置。从那些配置语句?任何其他的“预测”都是有用的。谢谢。
以上来自于百度翻译 以下为原文 I'm doing a design that's a tweak of the Solar LED / Charger that's described here as well as in AN1467. I imported the project files into MPLAB X v3.51 and told it to use the XC8 v1.33 compiler. It came in fine and compiles successfully but there are two __CONFIG statements that are listed as errors in main.c __CONFIG(0x39A4); __CONFIG(0x1FFF); I realize that C18 used these statement to set the configuration bits and that I should change these to pragma statements but my question is, how do I decipher what the old settings were from those CONFIG statements? Any other 'gotchas' you can predict might be useful too. Thanks |
|
相关推荐
6个回答
|
|
|
代码是为高科技而不是C18编写的。您可以使用OrthPrimeTyfFig的文字值,或者查看数据表的“配置字”部分来解码文字值并编写“γ-语用值配置值”。
以上来自于百度翻译 以下为原文 The code was written for Hi-Tech, not C18. You can either use the literal values with __PROG_CONFIG, or look in the "Configuration Words" section of the data sheet to decode the literal values and write #pragma config values. |
|
|
|
|
|
将十六进制转换为二进制。转到配置表上的数据表部分并比较它们。
以上来自于百度翻译 以下为原文 Convert the hex to binary. Go to the data sheet section on the configuration words and compare them. |
|
|
|
|
|
以上来自于百度翻译 以下为原文 PIC16F1509 configuration words +=========+=======+==========+=======================================+===========================================================================+ : Address : Value : Field : Category : Setting +=========+=======+==========+=======================================+===========================================================================+ : 8007 : 39A4 : FOSC : Oscillator Selection Bits : INTOSC oscillator: I/O function on CLKIN pin : : : : WDTE : Watchdog Timer Enable : WDT disabled : : : : PWRTE : Power-up Timer Enable : PWRT disabled : : : : MCLRE : MCLR Pin Function Select : MCLR/VPP pin function is digital input : : : : CP : Flash Program Memory Code Protection : Program memory code protection is disabled : : : : BOREN : Brown-out Reset Enable : Brown-out Reset disabled : : : : CLKOUTEN : Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin : : : : IESO : Internal/External Switchover Mode : Internal/External Switchover Mode is enabled : : : : FCMEN : Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled : +=========+=======+==========+=======================================+===========================================================================+ : 8008 : 1FFF : WRT : Flash Memory Self-Write Protection : Write protection off : : : : STVREN : Stack Overflow/Underflow Reset Enable : Stack Overflow or Underflow will cause a Reset : : : : BORV : Brown-out Reset Voltage Selection : Brown-out Reset Voltage (Vbor), low trip point selected. : : : : LPBOR : Low-Power Brown Out Reset : Low-Power BOR is disabled : : : : LVP : Low-Voltage Programming Enable : High-voltage on MCLR/VPP must be used for programming : +=========+=======+==========+=======================================+===========================================================================+ |
|
|
|
|
|
谢谢大家,这些回复真的很有用。有一件事看起来很奇怪,难道不应该有一些自动完成或错误检查的语法吗?我可以写……TraceMatg配置雷鸟= Goand,它编译没有错误!
以上来自于百度翻译 以下为原文 Thanks guys, those replies were really useful. One thing that seems weird though, shouldn't there be some kind of autocomplete or error checking on the #pragma statements? I can write... #pragma config THUNDERBIRDS = GO and it compiles without errors! |
|
|
|
|
|
这就是ANSI C89标准所要说的关于PyracM99的非常相似的地方。所以你看到XC8需要忽略它不承认的语用。
以上来自于百度翻译 以下为原文 Here's what the ANSI C89 standard has to say about #pragma C99 is very similar. So you see XC8 is required to ignore pragmas it doesn't recognise. |
|
|
|
|
|
我有时觉得可以在输出窗口中添加快速注释
以上来自于百度翻译 以下为原文 Which I sometimes find useful to add quick notes to the output window |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5795 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1126浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 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-3 13:53 , Processed in 1.886419 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1434