完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
您好,我必须初始化PIC16F15356与一个内部振荡器运行在1MHz。我使用编译器的版本可见的附加图像,我得到的编译错误,也可以看到在附加的图像。小代码是可见的:XFEC EX-COXFIGO OFFICT1,O-FSTOSCOSKYOTF&1;0配置图1,WDTCTPSYWTDTCPSY31和AWTDTCWSW WDTCWSW7.7和μWDTCCsHSC;CONT4;图3;O.COXFIG 0xFFFFE.CONFIGO-CONT5,O-CPYOFF ErrReal- 302;一些有用的定义,定义OSCCon BCF状态,RP0*定义BANKE1 BSF状态,RP0*定义SkIPyIFIF0BTFSS状态,Z定义SkIPyIFIFNOT零BTFSC状态,Z定义SKIPIPIFIFY承载BTFSS状态,C定义SKIPIPIFIFNOT携带BTFSC状态,C;****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
以上来自于百度翻译 以下为原文 Hello to all, I have to initialize the PIC16F15356 with an internal oscillator running at 1Mhz. I use the version of compiler visible in the attached image and I get compilation errors that are also visible in the attached image. The small code used is the visible one: #include "p16f15356.inc" ; CONFIG1 ; __config 0xFFEC __CONFIG _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT1 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON ; CONFIG2 ; __config 0xFFFF __CONFIG _CONFIG2, _MCLRE_ON & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_ON & _STVREN_ON ; CONFIG3 ; __config 0xFFFF __CONFIG _CONFIG3, _WDTCPS_WDTCPS_31 & _WDTE_ON & _WDTCWS_WDTCWS_7 & _WDTCCS_SC ; CONFIG4 ; __config 0xFFFF __CONFIG _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_ON ; CONFIG5 ; __config 0xFFFF __CONFIG _CONFIG5, _CP_OFF errorlevel -302 ;***** SOME USEFUL DEFINITIONS #define OSCCON BCF STATUS, RP0 #define BANK_1 BSF STATUS, RP0 #define SKIP_IF_ZERO BTFSS STATUS, Z #define SKIP_IF_NOT_ZERO BTFSC STATUS, Z #define SKIP_IF_CARRY BTFSS STATUS, C #define SKIP_IF_NOT_CARRY BTFSC STATUS, C ;********************************************************************** ORG 0 banksel OSCCON movlw b'00111000' movwf OSCCON END ; directive 'end of program' What am I doing wrong? Attached Image(s) |
|
相关推荐
18个回答
|
|
|
您好,您已经重新定义了OSCCon并使用了编译错误,因为“BANSEL OSCCon”(翻译为“BANSEL BCF状态,RP0”)和“MOVWF OSCCon”(翻译为“MOVWF BCF状态,RP0”)请求“BCF”符号被定义。你滥用了“OsCon”宏。
以上来自于百度翻译 以下为原文 Hello, You have redefined OSCCON and usage you have done gives compilation error because "banksel OSCCON" (translated as "banksel BCF STATUS, RP0") and "movwf OSCCON" (translated as "movwf BCF STATUS, RP0") requests that "BCF" symbol be defined. You are misusing "OSCCON" macro. |
|
|
|
|
|
Grazie JolibobYou可以编写一个小代码,将PIC16F15356的内部振荡器初始化为PIC12F629的1MHZIN,但也在PIC16F63中定义宏Byf定义BANKON0 BCF状态,RP0*定义BANKO1 BSF状态,RP0工作,PIC16F15356有什么不同
以上来自于百度翻译 以下为原文 Grazie Jolibob You could write a small code that initializes the internal oscillator for PIC16F15356 to 1Mhz In the PIC12F629 but also in the PIC16f73 the macros #define BANK_0 BCF STATUS, RP0 #define BANK_1 BSF STATUS, RP0 they work, what's different about PIC16F15356 |
|
|
|
|
|
首先,摆脱这条线,它没有为YouWo做任何有用的事情,我假设你正在尝试从另一个有一个叫“OSCCon”寄存器的PIC中修改一些代码。PIC16F15356有一个非常复杂的振荡器模块,使用寄存器OSCCON1、OSCCON2、OSCCON3、OSCFRQ、OSCSTAT、OSCTUNE。你可以通过配置1选择一个1MHz的内部振荡器,它根本不需要编写任何代码。RSTOSC=110(HFIFToSC 1 MHz)。
以上来自于百度翻译 以下为原文 First, get rid of this line #define OSCCON BCF STATUS, RP0 It is not doing anything useful for you Now, I assume you are trying to adapt some code from another PIC which does have a register named "OSCCON". A PIC16F15356 has a very complex oscillator module, using registers named OSCCON1, OSCCON2, OSCCON3, OSCFRQ, OSCSTAT, OSCTUNE and OSCEN. You can select a 1MHz internal oscillator just via CONFIG1, which doesn't require writing any code at all. RSTOSC=110 (HFINTOSC 1 MHz) |
|
|
|
|
|
这是配置;配置1;OnWdTFPSFE.CONFIGO-CONTI3,O-WdTCSPSY-WDTCSPSY31和A.WDTCWSW-WDTCWSW7.7和μWDTCCsHSC;CONT4;P.P.S.W.TSaFyOFF和O.LVPyon;CONT5;I.O.CONFIG0xFFFF,O.CONFIG-Ong5,Y.CpOffOSO,我不必写任何其他东西,PIC已经在1MHz工作了吗?
以上来自于百度翻译 以下为原文 This is the configuration ; CONFIG1 ; __config 0xFFEC __CONFIG _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT1 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON ; CONFIG2 ; __config 0xFFFF __CONFIG _CONFIG2, _MCLRE_ON & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_ON & _STVREN_ON ; CONFIG3 ; __config 0xFFFF __CONFIG _CONFIG3, _WDTCPS_WDTCPS_31 & _WDTE_ON & _WDTCWS_WDTCWS_7 & _WDTCCS_SC ; CONFIG4 ; __config 0xFFFF __CONFIG _CONFIG4, _BBSIZE_BB512 & _BBEN_OFF & _SAFEN_OFF & _WRTAPP_OFF & _WRTB_OFF & _WRTC_OFF & _WRTSAF_OFF & _LVP_ON ; CONFIG5 ; __config 0xFFFF __CONFIG _CONFIG5, _CP_OFF So I do not have to write anything else, with this configuration the PIC already works at 1Mhz? |
|
|
|
|
|
我想是的,我从来没有用过那个确切的照片。我只是试试看。我首先启用时钟输出引脚,并用一个范围来观察它,以验证它运行的速度。
以上来自于百度翻译 以下为原文 I would assume yes. I've never used that exact PIC. I'd just try it out and see. I'd start by enabling the clock out pin, and observing that with a scope, to verify exactly how fast it is running. |
|
|
|
|
|
如果有人在汇编语言中使用PIC16F15356编写代码并发布一些东西,这是受欢迎的。一般初始化、定时器管理、中断管理等。我一直使用旧的16F7312F629等,我发现这个新的16F15356i搜索因特网有很多困难,但是EXA。Mpple在汇编语言中对这16F15356似乎不存在感谢。
以上来自于百度翻译 以下为原文 If someone has used PIC16F15356 writing code in assembler language and publish something this is welcome. General initialization, timer management, interrupt management, etc. I have always used the old 16f73, 12F629 etc., I find many difficulties with this new 16F15356 I searched the internet, but examples in assembler language for this 16F15356 seem to be non-existent Thanks |
|
|
|
|
|
也许你应该更多地了解汇编语言,然后你会理解额外的指令。
以上来自于百度翻译 以下为原文 Maybe you should learn a bit more about assembly language. You'll understand the extra instructions then. |
|
|
|
|
|
也许你应该更多地了解汇编语言。然后你会明白额外的指令。是的,无论如何,谢谢你的帮助。
以上来自于百度翻译 以下为原文 Maybe you should learn a bit more about assembly language. You'll understand the extra instructions then. Yeah, anyway thanks for the help grin: |
|
|
|
|
|
或者切换到一个16位的芯片,更好的指令集和更多的寄存器加上你不必太担心寻呼。一些16位的芯片包含一个第二寄存器集,你可以在里面切换/下载。从微芯片下载:16位MCU和DSSCP程序员的参考手册。
以上来自于百度翻译 以下为原文 Or switch to a 16bit chip, better instruction set and more registers plus you don't have to worry about paging so much. Some 16bit chips contain a 2nd register set that you can switch in/out. Download from Microchip: 16-bit MCU and DSCProgrammer’ s Reference Manual. |
|
|
|
|
|
示例:在发送到实时时钟之前验证日期。
以上来自于百度翻译 以下为原文 Example: validate a date before sending to a real time clock. .include "DS3231RTCLib2.inc" .globl _rtc_validdate .section DS3231RTC,code ;---------------------------------------------------- .equ arg_Date, w0 .equ arg_Month, w1 .equ arg_Year, w2 .equ tmp, w3 .equ month30, w4 .equ leap, w5 _rtc_validdate: ;month cp0 arg_Month bra z,$+6 cp arg_Month,#12 bra leu,$+4 retlw #ERROR_RTC_MONTH,w0 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;date cp0 arg_Date bra z,err_date cp arg_Month,#2 ;feb bra z,february ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;not february mov #0b0101001010100,month30 btst.c month30,arg_Month cpb arg_Date,#31 bra leu,chk_year err_date: retlw #ERROR_RTC_DATE,w0 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ february: mov #28,tmp and arg_Year,#3,leap bra nz,$+4 inc tmp,tmp cp arg_Date,tmp bra gtu,err_date ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ chk_year: ;year mov #2000,tmp cp arg_Year,tmp bra ltu,$+10 mov #2199,tmp cp arg_Year,tmp bra gtu,$+4 retlw #ERROR_RTC_OK,w0 retlw #ERROR_RTC_YEAR,w0 ;---------------------------------------------------- .end |
|
|
|
|
|
|
|
|
|
|
|
感谢GORT2015,我很固执,我决定使用PIC16F15356,我将更好地学习如何使用它。我只是在寻找一个已经为PIC16F15356写了一些东西的人,只是为了加快编写编程代码。我将研究我的代码所必需的东西。
以上来自于百度翻译 以下为原文 Thanks Ghort2015, I am stubborn, I decided to use the PIC16F15356, I will study better how to use it. I was simply looking for someone who had already written something for PIC16F15356 simply to speed up the writing of the programming code. I will study what is necessary for my code |
|
|
|
|
|
如果你知道旧的PIC芯片只是研究额外的指令。
以上来自于百度翻译 以下为原文 If you know the old pic chip just study the extra instructions. |
|
|
|
|
|
感谢大家的帮助,我开始了解这些额外的问题。专家们问:PIC16F15356有没有GIG微芯片或其他制造商,允许MCU在PCB组装之前进行编程?
以上来自于百度翻译 以下为原文 Thanks for the help, I begin to understand the extras. A question to the experts: For PIC16F15356, are there any gig Microchips or other manufacturers that allow the programming of the MCU before it is assembled in the PCB? |
|
|
|
|
|
对。如果你从MICHCHIPIdToT.com购买芯片,你可以先提供一个HEX文件来编程,其中大约有29美元的安装费用。
以上来自于百度翻译 以下为原文 Yes. If you buy the chips from microchipdirect.com you can supply a hex file to be programmed into them first. There is a roughly US$29 setup charge, |
|
|
|
|
|
嗨,为什么不使用MixChIPDead网站了解更多关于增强的中程内核?http://MyCHIPCDeave/COM/8BIT:ErrObjc:
以上来自于百度翻译 以下为原文 Hi, Why not use the microchipdeveloper website to know more about enhanced Mid-Range core ? http://microchipdeveloper.com/8bit:emr Regards |
|
|
|
|
|
http://www. McCudio.com /WaveStudio/En/PIC16F15356*文件,16F15356的链接还没有数据表。AFEK,增强的中档设备具有BSR寄存器和用于银行的MOVLB指令。只要使用BoSSEL指令,就可以使用正确的指令。
以上来自于百度翻译 以下为原文 http://www.microchip.com/wwwproducts/en/pic16f15356#documents That link has no datasheet yet for the 16F15356. AFAIK, the enhanced mid-range devices have a BSR register and a MOVLB instruction for banking. Just use the BANKSEL directive and the correct instruction will be used. |
|
|
|
|
|
+1那些宏在新PIC16设备中不能工作。(或事实上,任何有两个以上银行的设备)BANSEL宏将在所有PIC16设备中工作。
以上来自于百度翻译 以下为原文 +1 Those macros won't work in new PIC16 devices. (Or in fact, any device which has more than two banks) The BANKSEL macro will work in ALL PIC16 devices. |
|
|
|
|
只有小组成员才能发言,加入小组>>
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 04:14 , Processed in 1.422926 second(s), Total 109, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
875