Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/13/08 17:58
Read: times


 
#160021 - It is seldom that simple ...
Responding to: ???'s previous message
Andy Neil said:
Richard Erlacher said:
Yes, the off-chip RAM high-address-byte appears on P2, on most chips (not necessarily on SiLabs) but it's really addressed by DPTR and not by P2.

Not with "classic" (see below) PDATA.
A "classic" PDATA access doesn't use the DPTR, and doesn't modify P2.

When using "classic" PDATA with off-chip memory, only the low address byte is modified during the memory access by a MOVX @Rn instruction; it is entirely up to the programmer to ensure that their high address byte (if the hardware has one!) is set appropriately.

Just how does the programmer ensure "that their high address byte (if the hardware has one!) is set appropriately?" I know it's not the best thing, in this context, to refer to specific hardware examples, but, how would one do that, in the general case?

By "classic" PDATA I mean memory accessed via the "classic" 8051 external memory interface, with P0 and P2 - Of course, how this happens in a device with on-chip PDATA/XDATA (like SiLabs?), or some other interface, is entirely device-dependent...

I've never tried that in a SiLabs or even a Maxim/Dallas part. It gets a bit sticky, though, as you address a larger block of RAM in the same way, e.g. using MOVX instructions, and the MCU automatically makes the transition from using its physically internal resources to physically external ones without a hitch. It often does that with different timing, despite the fact it's done as part of a single loop. It's the same way with code space. If you have a part that has, say, 16 kB of on-chip FLASH, and then uses code that is partially on-chip and partially off-chip, it makes the accesses quite transparently, possibly with different timing, yet as part of a single code segment. It can be entirely transparent to the programmer using a HLL.

It's getting messy, as 805x architecture expansion continues, and we need to be very precise with nomenclature in order to avoid mixing up details such as where the memory lives, physically, with how it's addressed.

Thoroughly agreed!

SiLabs provides 8 KB of what's addressable as external (sic) memory.

I think calling it "external" is unhelpful here - because it is internal to the physical device!
Especially as some SiLabs chips do also support off-chip memory!


Yes, and I'd be really interested in what happens when you put on an external 32KB of SRAM and then address the on-chip 8KB and the off-chip 32 KB as though they were the same block. I'd also be interested in knowing what happens when you access that on-chip 8KB block (on the 'F12x) using a MOVX A,@Ri instruction rather than with DPTR, which specifies the upper address.

I think the best way to describe it is as XDATA or, more precisely, as "MOVX-addressed"

ie, we take "XDATA" to be synonymous with "MOVX-addressed" which may or may not be physically off the chip.

I think PDATA is enough of a special case that it need only be mentioned when specifically used?

The trick is to keep things straight in our collective understanding, so that when we refer to a given thing, it's clear to everybody what is meant.

Agreed.
Unfortunately, a lot of marketing materials aren't concerned about such precision.

This is also a great example of where out-of-date materials can cause confusion: in the original 8051, XDATA was literally external; so "off-chip" and "external" were synonymous back then - unfortunately, that assumption still persists in some places today when it is blatantly no longer true!


I'm still not clear on why it makes a difference whether the memory range in question is on-chip or off. I can see how it could become troublesome, but, from what little I've done with it, it's just an "external" RAM block that's not off-chip. How your code talks to it is indifferent to its physical location.

One simple way in which a 32 KB chip would be attached to a "normal" 805x chip would be with P0 providing the low address during ALE, and P2 providing the high address byte. If one simply were to use A15/P2.7 to select (as nCS) the external 32Kx8 part, the fact that the bottom 1KB, or 8KB or whatever, lives on-chip would be entirely transparent to the code, and to the coder. The only case in which it would make any difference at all would be if the access timing were different, which, under firmware control, it can be. However, if, for some reason, one wished, for some obscure reason, to conceal, from the external observer, the traffic on that portion of the "external" memory space that can be on-chip, one might actually want to do things in exactly this way.

I'm curious, too in what's the benefit of using that "PDATA" access (MOVX A,@Ri) to external or pseudo-external read/write memory, and in the general effect of using that mode for accessing on-chip memory on the various chips that provide more than 256 bytes. The DPTR instructions are single-cycle ones, too, aren't they?

As one who frequently has to move fairly large blocks of data from one place to another, often at substantially different rates, I frequently have to deal with external memory. Often, it influences my choice of processor. Many people believe that, if a thing can't be done easily with a few lines of 'C' code on an 805x, it has to be done with a "bigger" processor. I am not among them, however. As long as it's cheaper to use an 8-bit MCU, I'll do that, and attempt to wring every bit of utility out of the hardware. Once ARM's and big flash memory, and SDRAM become cheap enough, in combination with the external hardware they require, to do the job for less cost, that may change.

RE





List of 34 messages in thread
TopicAuthorDate
a simple SETB question            01/01/70 00:00      
   SETB from 20h to 2FH            01/01/70 00:00      
      assembler missed this one            01/01/70 00:00      
         I know of none that can't            01/01/70 00:00      
   what about this?            01/01/70 00:00      
      try ORL to set any bit in internal RAM            01/01/70 00:00      
         wrong, nonstandard and why            01/01/70 00:00      
            ORL, Set any bit (more informative)            01/01/70 00:00      
               iram            01/01/70 00:00      
                  Where is that defined?            01/01/70 00:00      
                     my word was not 'defined' but            01/01/70 00:00      
                        a rose, by any other name ...            01/01/70 00:00      
                           I think Erik has it?            01/01/70 00:00      
                              aliased/overlayed            01/01/70 00:00      
                                 Fair enough            01/01/70 00:00      
                              pDATA?            01/01/70 00:00      
                                 Why do you think 64TB would be enough?            01/01/70 00:00      
                                    It would not be            01/01/70 00:00      
                                       Tools are important for size            01/01/70 00:00      
                                          That's why there's ASM to use instead            01/01/70 00:00      
                                       this flies against some previous posts of yours            01/01/70 00:00      
                                          It's like herding cats            01/01/70 00:00      
                                             Flame bait?            01/01/70 00:00      
                                                No ... not really            01/01/70 00:00      
                                                   yes            01/01/70 00:00      
                                 PDATA & XDATA            01/01/70 00:00      
                                    I won't argue that ... but ...            01/01/70 00:00      
                                       Agreed, but...            01/01/70 00:00      
                                          It is seldom that simple ...            01/01/70 00:00      
                                             That's the point!            01/01/70 00:00      
                                             since you are really interested            01/01/70 00:00      
                                                Thanks!            01/01/70 00:00      
      Yes, that is the way I normally do it            01/01/70 00:00      
      WHY TO DISTURB ACC ?            01/01/70 00:00      

Back to Subject List