完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,我正在浏览数据表,我想知道程序存储器是如何工作的,不管是12, 14个还是16个指令字。例如,关于PIC16F87A,在下面的图片中:让我们采取面向字节的文件寄存器操作,它被划分为:1。7位文件寄存器地址,我对这部分的问题是:*这个文件地址在哪里?是RAM还是闪存?*无论是在RAM还是闪存中,寻址如何仅用7位?2。1位,目的地寄存器,我理解。3。6位操作码,这是具体的指令,如ADDWF、MOVF、BTFSS…我对这部分的问题是:*对于字节为导向的操作,有特定指令在6位范围内,但它们可以在其他操作中工作;例如,位和文字运算。我的假设正确吗?或者每种类型的操作都有其特定的指令号?此外,对于图片中的最后一部分,文字值如何为11位。
以上来自于百度翻译 以下为原文 Hello, I'm going through the datasheet and I want to know how the program memory works with whether it's 12, 14 or 16 instruction words. For example, regarding PIC16F877A, in the following picture: Let's take the byte-oriented file register operations, it's divided as: 1. 7-bit file register address, my questions about this part are: * Where is this file address? Is it in the RAM, or flash memory? * Whether it's in the RAM or flash memory, how does the addressing work with only 7-bits? 2. 1-bit, for destination register which I understands. 3. 6-bit opcode, which is the specific instruction; like, ADDWF, MOVF, BTFSS ... etc. My question about this part is: * For the byte-oriented operations there're specific instructions which are within the 6-bit range but they may work on other operations; like, bit and literal operations. Is my assumption correct? Or each type of operations has its specific instruction number? Also, for the last part in the picture, how can a literal value be 11-bits |
|
相关推荐
19个回答
|
|
|
7位地址总是指GPR/SFR RAM空间,7位地址与状态寄存器中的两个存储体选择位相结合。这都是在数据表中解释的。你的问题是模糊的,不可能回答的。我认为你试图制定一般的规则来适用于所有的指令,当它们只适用于一些指令时,给出一个你不理解的精确的例子。这只适用于G。OTO和调用指令。操作码只有3位,留下11位的地址。这在数据表中的指令集表中是很清楚的。
以上来自于百度翻译 以下为原文 7 bit addresses always refer to GPR/SFR RAM space. The 7 bit address is combined with two bank select bits from the STATUS Register. This is all explained in the datasheet. Your question is vague and impossible to answer. I think you are trying to make general rules to apply to all instructions, when they only apply to some groups of instructions. Give one precise example of something you don't understand. That only applies to the GOTO and CALL instructions. The opcode is only 3 bits, leaving 11 bits for the address. This is clear in the INSTRUCTION SET table in the datasheet. |
|
|
|
|
|
首先,谢谢你的回答。很抱歉,这是非常明显的:)在查阅数据表后,RAM被分成4个银行,我已经知道这一点,但不知道地址是如何工作的;例如,解释学生14位字是如何工作的。LY没有清楚地理解3指令集类别。好的,在查看表:表15-2:PIC16F8XA指令集之后,3类有特定的指令集。好的,现在我想知道的是银行选择如何处理这3个类别,银行选择位适合于14位字。现在,我理解了大部分的想法,7位寄存器地址,1位目的地和6位操作码。例如,让我们使用指令Advf,14位指令如下,我跳过这个字作为部分:1×2×3×4×0 0 0 1 1 1 f f f f f f f1:这就是我所做的。不知道,这是两个银行选择位吗?那么对于不同的银行,这两个零点可以是01, 10还是11?我的第一个问题2:这是操作码地址,我理解这一部分。3:这是操作结果的目的位,我理解这一部分。4:这是文件寄存器地址,7位可以到127个地址,但是这部分与银行选择相结合。位?我的第二个问题是关于第1和第4, 2和第3部分的问题被理解。这里我关心的是字面值,但这是数据表中的一个引文。所以我认为这个值可以达到4096小数,我想我不确定。
以上来自于百度翻译 以下为原文 First of all thank you for the answer. OK, sorry that was very obvious :) After looking into the datasheet the RAM is divided into 4 banks and I know this already, but didn't know how the addressing works; e.g. explaining the students how 14-bit word works. Sorry for the vague question here, I actually wasn't having a clear idea of the 3 instruction set categories. OK, after looking into the table: TABLE 15-2: PIC16F87XA INSTRUCTION SET The 3 categories have specific instruction set. OK, now the most idea I want to learn about is how the bank select is working with the 3 categories, where does the bank selecting bits fit into the 14-bit words? Now I understand most of the idea, the 7-bit register address, 1-bit destination & 6-bit opcode. For example, let's take the instruction ADDWF, the 14-bit instruction is as follows, I'm diving the word as parts: | 1 | | 2 | |3| | 4 | 0 0 0 1 1 1 d f f f f f f f 1: this is what I don't know about, is it the two bank select bits? so the two zeros could be 01, 10 or 11 for different banks? <-- My first question 2: This is the opcode address and I understand this part. 3: This is the destination bit for the result of the operation and I understand this part. 4: This is the file register address and the 7-bits can range to 127 addresses, but does this part combines with the bank select bits? <-- My second question So I have questions about part 1 and 4, 2 and 3 are understood. Here my concern is about the literal value but this is a quote from the datasheet. So I think the value can range upto 4096 decimal I guess not sure. |
|
|
|
|
|
如果这些比特可以适应指令,就没有必要进行银行选择。正如我上面所说的,这两个比特来自状态寄存器,而不是指令。正确地设置这些存储体选择位(选择正确的存储体)是每个人的任务。访问RAM和SFR。不,这是操作码的一部分。银行选择位来自状态寄存器中的位RP0和RP1。是的,七位,加上两个存储体选择位给您九位,这足以解决该设备中的所有RAM。注意:7位给您128个地址,0~127。这里我关心的是字面值,但这是一个。因此,我认为这个值可以达到4096小数,我想不确定。再看看指令集表。像MOVLW、ADDLW等的指令有八个“K”位。只有十一个“K”位的两个指令是GOTO和CALL。它们被用来提供较低的十一个B。它的地址跳到。实际上,还有两个额外的位用于这些指令,但是它们被称为“页面选择”位,并且是必需的,因为您需要13位来处理该PIC族中的所有代码存储器(Flash)。
以上来自于百度翻译 以下为原文 It doesn't. If those bits could fit into the instruction, there wouldn't be any need for bank selection. As I said above, those two bits come from the STATUS register, not from the instruction. It is the prgrammer's job to correctly set those bank select bits (to select the correct bank) before each access to RAM & SFR's. No, that is part of the opcode. The bank select bits come from bits RP0 and RP1 in the STATUS register. Yes, those seven bits, plus the two bank select bits give you nine bits, which is enough to address all the RAM in that device. Note: 7 bits gives you 128 addresses, 0-127. Here my concern is about the literal value but this is a quote from the datasheet. So I think the value can range upto 4096 decimal I guess not sure. Look at the INSTRUCTION set table again. Instructions like MOVLW, ADDLW, etc have eight "k" bits. The only two instructions that have eleven "k" bits are GOTO and CALL. They are used to supply the lower eleven bits of the address to jump to. In effect there are two extra bits for these instructions also, but they are called "page select" bits, and are required because you need 13 bits to address all the code memory (FLASH) in that family of PICs. |
|
|
|
|
|
为了通过直接寻址来处理数据存储器寄存器,AuLoad MUX将来自状态寄存器的存储体选择位RP1和RP0和来自操作码的7位地址组合为9位地址,能够寻址0x000—0x1FF。E AluAuthMUX将页面选择位4和3从PCLASE寄存器和11位地址从操作码转换为13位地址,能够寻址0x0000—0x1FFF。
以上来自于百度翻译 以下为原文 To address the data memory register via direct addressing, the To address the program flash memory (for CALL and GOTO) the |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
啊!Z80'Si切断我的牙齿在那些良好的老4位处理器。(继续,采取诱饵!)眨眼:
以上来自于百度翻译 以下为原文 Ah! Z80's I cut my teeth on those good old 4-bit processors. (Go on, take the bait!) wink: |
|
|
|
|
|
|
|
|
|
|
|
好的,配置银行选择位的问题是在汇编中编写代码,XC8编译器负责选择银行位。但对于装配,我记得使用银行卡,如果我需要更多的银行从其他银行,SFRs直接调用没有申请银行指令,是我的理解权?好的,我知道这是整个操作码列表的一部分。不完全理解这一点,但这不是必要的,因为我刚刚理解了14位的概述以及它是如何工作的,非常感谢。
以上来自于百度翻译 以下为原文 OK, the issue of configuring the bank select bits is for writing the code in assembly, and XC8 compiler is taking care of selecting the bank bits. But for assembly I remember to use BANKSEL if I need more registers from other bank, and the SFRs are called directly without applying BANKSEL directive, is my understanding right? OK, I understand that's part of the whole opcode list. Not understanding this completely but it's not necessary because I just understood an overview of the 14-bit and how it works, thank you so much. |
|
|
|
|
|
那又怎么样!你在开我玩笑吗?眨眼:别担心,我会给你留下深刻的印象,我自己做了AVR的好项目!我可以把我在C中做的片段发给你,不是那么多那么大,但是很好。这是我的水平,作为一个教练与mikroC嵌入式系统的基础知识,我告诉他们,在大学我更喜欢与AVR芯片工作,但他们告诉我,他们有很多PIC16F87A与MikROC,所以没关系,我正在做一个关于嵌入式系统基础的学生手册,我只是问了14位字,因为我不太了解它,所以我可以解释给学生,虽然它并不重要,因为他们是文凭学生,最重要的是做一些简单的项目。因为公司改变了课程计划,这是关于英特尔8085,新的计划是两个单位如下:首先我不知道很多关于英特尔8086,我只是学习电子文凭,并获得学士学位的职业教育学,所以我没有学到任何关于微处理器。第二,我不能在16周内推动这两个模块,除非我很专业,计算机科学的研究生。所以,我决定做一个手册,因为公司提供了一个新的计划,但没有提供这本书。你认为我现在不是一个足够的教练吗?
以上来自于百度翻译 以下为原文 So what! You making a joke of me right now? wink: Don't worry I can impress you in programming, I did good projects in AVR by myself! I can send you my file of the snippets I did in C, not so much and so huge, but it's good. It's about my level to be a trainer teaching basics of embedded systems with mikroC, I told them in the college I prefer working with AVR chips but they told me that they have a lot of PIC16F877A with mikroC, so it's OK. Also, I'm doing a students manual about basics of embedded systems, and I just asked about the 14-bit word because I wasn't understanding it so well, so I can explain it to the students although it's not so important to them because they are diploma student and the most important is to do some simple projects. Because the corporation changed the course plan and it was about the intel 8085, and the new plan is two units as follows: First of all I don't know much about intel 8086, I just studied electronics diploma, and got a bachelor in vocational pedagogy, so I didn't learn anything about microprocessors and very little about microcontrollers. Second, I can't push the two modules in 16 weeks unless I'm so professional and a graduate students in computer science. So, I decided to do a manual, because the corporation provided a new plan but didn't provide the book. So do you think now I'm not a sufficient trainer? |
|
|
|
|
|
是的,C编译器会为你负责银行业务。不,你还需要SFRs的银行卡。查看数据内存映射,您会看到SFRs以及GPRS被分组为银行。你确实需要选择共享内存0x70~0x7fBank。再次阅读我以前的帖子。
以上来自于百度翻译 以下为原文 Yes, the C compiler will take care of the banking for you. No, you still need BANKSEL for the SFRs too. Take a look to the data memory map and you'll see SFRs as well as the GPRs are grouped into banks. You do _not_ need to select bank for the shared memory 0x70-0x7F. Read my previous post again. |
|
|
|
|
|
希索什么?你在开我玩笑吗?我不会这么说。但是,我不想太苛刻,因为我不知道全部的内容。抱歉。我放弃了高中的钓鱼比赛。如果我没有所有的东西,正如我们在这里说的,“在舌尖”,我就不会在数字电子学第二学期(14周学期有6个不同的分配)。我知道你的意思,在我作为一个初学者的第一次比赛中。2个不同的分配问题,“计算机体系结构”和“编程(桌面)”的帽子问题。这里的问题是,我发现奇怪的是,有人在测试微控制器电子学时,仅仅通过在数据表中查看几分钟的表就不能完全理解ASM操作码结构。TS和寻址方案与银行选择和页选择位的第一次读的部分在内存组织。需要帮助这些基本的东西,可能是自然的爱好者水平,但几乎没有资格为乳头。至少在这附近。
以上来自于百度翻译 以下为原文 Hi So what! You making a joke of me right now? wink: I wouldn't put it that way. But, I don't want to be too harsh, as I'm not aware of the full context. Sorry. I gave up pissing contests back high school. I wouldn't have made it past the second semester in digital electronics (14 weeks semesters with 6 different assignements) if I hadn't all that stuff, as we say here, "at the tip of the tongue". I know what you mean, in my first yeasr as a teatcher I had that problem on 2 different assignements, "computer architecture" and "programming (desktop)". The point here is that I find it odd, that someone teatching microcontroler electronics, is not able to fully understand the ASM opcode structure just by looking at the table in the datasheet for a few minuts, and the addressing scheme with the bank select and page select bits at first read of the section on memory organization. Needing help for such basic stuff, might be natural at hobbyst level, but hardly qualifies for teatching. At least around here. |
|
|
|
|
|
我要上钩了!LOL:只是为了防止未来读者成为MISLADEDLOL:“4位微处理器”与“I8080/I8085”衍生的8位“Z80”之间存在一定的时间鸿沟。
以上来自于百度翻译 以下为原文 Hi I'm taking the bait! LoL: Just to prevent some future reader to be misleaded LoL: There was a bit of time gap between "4 bit micorsprocessors" and the 8 bits "Z80" derived from the "i8080/i8085". |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SHIISSE网站不会让我发布甚至在HTTPS模式。无论如何,我错了,我的第一本关于CPU的书只从8080开始,在8008和4004有一些提示,谢谢你,我不知道!
以上来自于百度翻译 以下为原文 scheisse website won't let me post even in https mode. Anyway: I was wrong, my first book about CPUs only starts with 8080, with some quick hints at 8008 and 4004; and thanks for that Concertinaman, I did not know! |
|
|
|
|
|
|
|
|
|
|
|
我在一定程度上同意了豪尔赫的观点。以你的问题为例,你(MIS)理解这个操作码中的两个高位,当银行选择比特时,你为什么这样认为?对我来说,如果这些是两个银行选择位,操作码将被写入数据表ASNN 0111 DFFF FFFF,其中NN表示银行选择位。
以上来自于百度翻译 以下为原文 I agreed with Jorge's point to an extent. Take your questions as an example, You (mis)understood the two upper bits in this opcode as the bank select bits, why do you think that? To me, if these are the two bank select bits the opcode would be written in the datasheet as nn 0111 dfff ffff where nn denotes bank select bits. |
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1097浏览 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 08:25 , Processed in 1.243067 second(s), Total 111, Slave 93 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2016