完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
每一本书都要制作一个模板,这是一个最小的粘贴到文本文件MPLAB X IDE的Microchip模板。当你使用Microchip模板并粘贴文本时,它会产生很多错误。
以上来自于百度翻译 以下为原文 Making a template per the book. This is Microchip template minimum pasted into text file MPLAB X IDE. When you use Microchip template and then paste text into it it will give lots of errors. Use Add Text file to make program from scratch. Attached Image(s) |
|
相关推荐
11个回答
|
|
这里是来自Project的文件。需要使用Erg和org而不是MPLAB X时代的DrimthVist.Labx已经编译过它们。
以上来自于百度翻译 以下为原文 Here's file from project. Need to use EQU and ORG instead of MPLAB X era directives. LAB X has compiled them before. list p=16F54 ; list directive to define processor #include __CONFIG _CP_OFF & _WDT_OFF & _RC_OSC RESET_VECTOR CODE 0x1FF ; processor reset vector goto start MAIN CODE 0x000 start END ; directive 'end of program' |
|
|
|
这里是完成模板。
以上来自于百度翻译 以下为原文 Here is done template. list p=16F54 ; list directive to define processor #include __CONFIG _CP_OFF & _WDT_OFF & _RC_OSC ;Declaations porta equ 05 portb equ 06 org 1FFh goto Start org 0 ;Subroutines Init clrf porta clrf portb movlw b'0000' tris porta movlw b'00000000' tris portb ;Program Start Start call Init MAIN END ; directive 'end of program' |
|
|
|
|
|
|
|
最后一个重要的警告词:每当你自己改变PCL(例如加上一个数字),或者每当你使用一个调用指令时,程序计数器的位8就被清除到0。让我们来思考一下这意味着什么。程序存储器的512地址(称为页)用9位(位0~8)寻址。如果位8被自动清除,则地址限于位置0至255(称为页的前半部分)。结果是,所有子程序必须在页面的前半部分放置(或至少启动),尽管您可以从页面中的任意一个调用它们。此外,如果你想使用上面描述的变量跳跃,这些也需要在程序的前256个指令中进行。“以防万一有人一直怀疑我是否一直保持忙碌。”NIC PIC很有趣,而不是把它们称为陷阱或陷阱。保持笔直和狭窄,只做文本,直到它得到投影机和银行业务。这一点关于“半分页”对我来说已经足够了。
以上来自于百度翻译 以下为原文 'One final, important word of warning: whenever you change the PCL yourself (e.g. add a number to it) or whenever you use a call instruction, bit 8 of the program counter is cleared to 0. Let’s think about what this means. The 512 addresses of program memory (called a page) are addressed with 9 bits (bit 0–8). If bit 8 is automatically cleared, the addresses are limited to locations 0–255 (referred to as the first half of the page). The result is that all subroutines must be placed (or at least start) in the first half of the page, though you can call them from anywhere in the page. Furthermore, if you want to use the variable jumps described above, these too need to take place in amongst the first 256 instructions of the program.' Just in case anybody has been wondering if i have been keeping busy. This quote is the kind of thing we have come around to calling 'What makes learning PIC's interesting'. As opposed to calling them pitfalls or booby traps. Staying on the straight and narrow and just doing text in order until it gets to paging and banking later. This little bit about 'semi paging' is enough for me right now! |
|
|
|
只有当你足够愚蠢地坚持那些具有这些局限性的古代图片时才是相关的。
以上来自于百度翻译 以下为原文 Only relevant if you're silly enough to persist with ancient PICs that had those sorts of limitations. |
|
|
|
|
|
|
|
昨晚通过PIC16F54章节阅读(掠过)。这有点帮助,但没有看到。这是什么“寻呼”和“银行”。在这个16FX部分,你到16F57和做一些程序内存分页。我从它拿走了一个程序将“顺序”运行好。处理寻呼。引起故障的原因是Goto和子程序调用。我从它那里拿走的不是再次浏览。或者至少不去读细节。好的,看看现在发生了什么,但是现在不要尝试去理解它。用Time0将延迟循环回到正轨。这太有趣了!
以上来自于百度翻译 以下为原文 Read (skimmed) ahead last night through the PIC16F54 chapter. It sort of helped and it didn't. Was seeing what there was to this 'paging' and 'banking'. In this 16Fx section you get to the 16F57 and do some Program Memory paging. What I took away from it was a program will run 'sequentially' okay without dealing with paging. What causes the trouble is GOTO's and subroutine CALL's. What I also took away from it was NOT to skim ahead again. Or at least not to read the details. Okay to see what's coming up but not try and understand any of it now. Will get back on track with the delay loops using Timer0. This is big fun! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
到目前为止,我们已经涵盖了相当多的指令,重要的是要记住所有这些指令,所以你可以在他们的指尖上掌握它们。即使你不知道确切的指令名称(你可以在附录C中查看),你应该熟悉什么是可用的指令。“这听起来是个好主意。我的新方法是:1读取第2章加载程序示例3。在模拟器4中观看它。在它旁边有一个检查标记,然后继续前进。
以上来自于百度翻译 以下为原文 'So far we have covered quite a few instructions and it is important to keep track of all of them, so you have them at your fingertips. Even if you can’t remember the exact instruction name (you can look these up in Appendix C), you should be familiar with what instructions are available.' This sounds like a good idea. My new approach will be this: 1 read chapter 2 load program sample 3 watch it in simulator 4 run it in hardware Then put a check mark next to it and move on. We will give that a shot. |
|
|
|
只有小组成员才能发言,加入小组>>
5183 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3178 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2229 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
510浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 22:08 , Processed in 1.499973 second(s), Total 97, Slave 80 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号