The difference of Data,idata,xdata,pdata in 51 single chip microcomputer

Source: Internet
Author: User
  said ashamed, has always been, in school is also a lot of things, but instead of 51 single-chip computer This basic thing did not seriously to do, at the beginning of self-study 51 not one weeks, and then to Freescale 16 single-chip machine up, so that 51 has not thoroughly made a clear.          is not as good as I know s12 monolithic computer what piece of RAM Ah, flash size Ah, instead is 51 not sure answer OH.          such as today again see this problem, have seen before, but because has been not how to compile the program, so on 51 single-chip computer data, idata, XData and pdata have been unclear, but today no longer take off, the decision must be clear. --------------------------------------------------------------------------------------------         attach 51 in-chip resource brief, remember again.        . 8-bit CPU 4kbytes program memory (ROM) (52 8K) 256bytes data Memory (RAM) (52 with 384bytes of RAM) • 32 Strips i/   O-Port Line • 111 instructions, mostly single-byte instructions • 21 dedicated registers • 2 programmable timing/Counters • 5 interrupt sources, 2 priority (52 6) • One full-duplex serial pass • External data memory address space for 64KB external program memory addressing space of 64kB • Logic operation bit addressing function • Dual in-line 40PinDIP package • Single power supply   CPU: consists of operation and control logic, and includes interrupt system and some external special function registers; RAM: used to store data that can be read and written, such as the intermediate result of the operation, the end result, and the desired Data displayed; ROM: Used to store programs, some raw data and tables; I/O port: Four 8-bit parallel I/O ports can be used as input or output; T/C: Two Timer/register, either working in a timed mode or working in a counting mode; interrupt control system of five interrupt sources; Serial I/O port for full UART (Universal asynchronous receive transmitter) for singleThe serial communication between the chip machine or the MCU and the microcomputer, the on-chip oscillator and the clock generating circuit, the quartz crystal and the trimmer capacitor need the external. The maximum oscillation frequency is 12M. --------------------------------------------------------------------------------------------          back to the topic, from the data storage type, the 8051 series has on-chip, on-chip program memory, on-chip, off-chip data memory, the on-chip program memory is also divided into direct addressing areas and indirect addressing types, respectively, corresponding to code, data, XData, Idata, and pdata types, which are set according to the 51 series, use different memory to make program execution more efficient, and when writing a C51 program, it is best to specify the storage type of the variable, which will help improve program execution efficiency (this issue is explained later). and ansi-c slightly different, it only sub-SAMLL, COMPACT, large mode, a variety of different models corresponding to the actual hardware system, there will be different compilation results.   Data,idata,xdata,pdata in the 51 series:   Data: fixed refers to 128 ram in front 0x00-0x7f, can be read and written directly with ACC, the fastest, generated code          is also minimal. Idata: Fixed refers to the previous 0X00-0XFF 256 RAM, of which the first 128 and data 128 are identical, only because the          asked the way different. Idata is accessed in a pointer-like manner in C. The statements in the assembly are:           MOX ACC, @Rx. (Unimportant supplement: C-Idata does a good job of pointer-type access). XData: External extended RAM, generally referred to as external 0x0000-0xffff space, accessed with dptr. pdata: Low 256 bytes of external extended RAM, address reads and writes on A0-A7, with Movx ACC, @Rx           read/write. This one is special, and C51 like.For this bug, it is recommended to use less. But also has his merit, the              body usage belongs to the intermediate question, does not mention here.


Original link; Https://www.cnblogs.com/pang123hui/archive/2011/04/02/2309904.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.