Detailed explanation of Misaligned connections between ARM and memory address lines

Source: Internet
Author: User

First, the sst39vf16 flash is 16 bits, and the minimum operating unit is two bytes (half characters. That is to say, if you give 0x00000 to the flash Address, the data provided by the flash Address is the first 16-bit half-character. If you give 0x00001 to the flash Address, it gives the second 16-bit half word; 0x00002 to the flash Address, it gives the third 16-bit half word... However, the arm address is a byte address, which can read or write peripherals in bytes.
Suppose we want to read the first [color = # ff0000] Byte [/color], ldrb r0, [R1] of Flash; write R1 content 0x00000, in this case, arm performs the following operations:
1. Sending address 0x00000
2. Read data on the D0-D15
3. Send the [color = # ff0000] low [/color] 8 bits of the 16-bit data to the R0 low 8 bits (the 24 bits are 0)

Suppose we want to read the second [color = # ff0000] Byte [/color], ldrb r0, [R1] of Flash; write R1 content 0x00001,
In this case, arm performs the following operations:
1. Output address ox00001
2. Read data on the D0-D15
3. The [color = # ff0000] High [/color] of the 16-bit data is given to the low 8 bits of R0 (the High 24 bits are 0)

as shown in the preceding operation, if we connect the arm and flash address one by one, we can't read the 2nd bytes of flash. Because you give the address 0x00001, flash will give 3rd bytes and 4th bytes of data on the data line, and the height is 8 bytes (4th bytes of Flash) to R0; if the address you give is 0x00000, arm's understanding is to give the low 8-bit D0-D15 of the data line to r0, obviously, the 16-bit data is the 1st bytes and 2nd bytes of flash data. The low 8-bit data refers to the first data of its own. Obviously, we cannot read 2nd pieces of flash data.
we must follow the arm rules and let flash give us correct data. What should you do? It is very easy to cut off the IP token given by arm and give the rest to flash. To read 2nd bytes, we still get 0x00001, but the last 1 is cut off. The address obtained by Flash is ox00000. Obviously, the data given is 1st bytes and the second byte. Arm thinks that the sent address is 0x00001, and the high address should be given to r0, that is, 2nd bytes should be given to R0. Is a process of "bullying.
I have read the Article In http://www.100ask.net/showtopic-308.aspxand read the relevant materials to share with you ....

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.