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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/07/09 19:19
Read: times


 
#163211 - It's much easier with the 8-bit single-clocker
Responding to: ???'s previous message
David Prentice said:
Richard Erlacher said:
Now, performance is of considerable import, so tell me, does that $4.28 ARM allow you to move 256 bytes on an odd-byte boundary and in bytes in less than 65 microseconds, say, from RAM to external 8-bit port?


Yes. This question is answered. And without having to unroll loops.

In my particular case, all I'm asking the MCU to do is to generate the addresses, sequentially, at 33.333 MHz. That's actually 0.1% above what the datasheet says it can do, but, what the hey!. I could use 33.00 MHz just as well. The cycle, actually, is 120 ns long, but the read or write is half that length, The RAM has a 55 ns access time, but I have to reduce a 16-bit word to two bytes, yet still "stuff" them into the RAM with a 5 ns CPLD. It all "just barely" meets the mark under worst-case conditions. I considered using a 60 ns external memory cycle and twice as many, but it's no easier.

This has to occur in exactly 60 ns per byte (actually, it's in words, but the MCU doesn't care)


No. This is not possible with the 58MHz ARMs.

That's what I was getting at. Doing these time-critical things is not so easy with low-end ARM's. The last one I used was an ARM9 at 100 MIPS. They aren't any easier just because they're faster. The 8-bitters are easier to use when you have to meet the mark in timing. The point, I guess, is that the 8-bitters are designed around the noiton that everything has to be synchronous, as it was with the old 8-bit microprocessor busses, while the 16-bitters operate with a more asynchronous bus, reminiscent of the '80's generation minicomputers. Once they start using a cache, and interrupts, everything goes to hell in a handcart with respect to event timing.

I have not read the Dallas data sheet, but I can only assume that you are using external hardware to read the 8051 address/data bus. I would guess that any chip with an external address/data bus could do the same.

Yes, that's what I'm doing. Indeed, it could be done, provided its timing is totally synchronous, i.e. every external cycle is timed exactly the same and occurs predictably with respect to previous cycles.

Having assumed that you were reading XRAM or AUXRAM to a PORT, I was at a loss to understand how you could get any 8051 to do 256 LOADs and STOREs inside 65 microseconds. ( A single MOVX taking 2 machine cycles. )

That's why I have to "fiddle" with the system clock, too. The target peripheral has a 120 ns cycle time for reads and writes. The external bus cycle in "non-page-mode (the conventional 805x external bus access cycle) takes four clock ticks, which is already 120 ns. The bus cycle can take any (well, not quite any) multiple of 30 ns in PageMode1. In PageMode1 it muxes both high and low address on P2, while presenting data on P0. The MCU hardware can stretch a cycle. During ALE, it switches from what's in the P0 latch to the DPL content. However, one can register (with a '273-type construct) that P0 content at the rising edge of ALE, before it changes to the data (provided the required pullups are there, else the ones won't appear soon enough). You can then make use of the output port. That can provide high address bits if they're needed. That's part of the overhead I mentioned. Because the MOVX instruction consists of a fetch of the DPH content, which takes an extra clock cycle, the MUX switches back to port latch content during that extra (internal but actually occurring first) cycle. I have to fiddle with the external oscillator period because of the way in which the MCU handles its cycle-stretching so that the entire cycle still takes only 120 ns.

Most of this trickery wouldn't be so easy to implement with an ARM-core device because of variable internal latency. It would have been nearly impossible, had I needed the UART or timers. All the timing is synchronized by the execution time of the code.

I have learned more about how two different ARM compilers generate code. I have also learned about 8051 instruction set and 8051 C compilers.

Good luck with your project.

David.


The ARM is an excellent computing machine. It's not as easy to use as a hardware substitute, though. Clearly our "world views" differ with respect to the role of the MCU in a system design. However, I had the constraint, additionally, that the original system had a 40-pin DIL-packaged 8052 in it ... AFAIK, they haven't yet built an ARM-core MCU with 8052-compatible pinout. If they did, I'd find that really exciting!

I put the CPLD in this machine in '91. It had "room" to accomodate the additional features I needed, so that was just a design entry task. The original 8052 was replaced with a Dallas part in 2001 in order to take advantage of the extra RAM it had on-chip.

What interested me about this task was that I could add a huge additional capability to the system with very minimal changes to the architecture or, for that matter, the hardware. Adding the extra data channels involved just very little additional hardware, e.g. buffers, connectors and that sort of thing, and, with some imagination, I was able to make that fit on already present features.

RE


List of 76 messages in thread
TopicAuthorDate
NXP P89LPC936 Auxilary RAM            01/01/70 00:00      
   Compiler Cannot Save the Day At Runtime            01/01/70 00:00      
      I found it.....            01/01/70 00:00      
         Incorrect!            01/01/70 00:00      
            To be fair,...            01/01/70 00:00      
               Its good info to know...            01/01/70 00:00      
   how is it done in C?            01/01/70 00:00      
   Maybe you should try doing it ASM!            01/01/70 00:00      
      You should start a new thread on that!            01/01/70 00:00      
      Not in this case!            01/01/70 00:00      
         A compiler should support ALL MCU features ...            01/01/70 00:00      
            A compiler should translate the language            01/01/70 00:00      
               Still C - just not strict.            01/01/70 00:00      
            I didn't say that!            01/01/70 00:00      
               It is not that clean and clear            01/01/70 00:00      
                  Deviants are deviant            01/01/70 00:00      
                     Keil and SDCC need no macros ...            01/01/70 00:00      
                        Are you sure?            01/01/70 00:00      
                     That's probably correct, but ...            01/01/70 00:00      
                        A C compiler can map the hardware quite well            01/01/70 00:00      
                           compiler vendors are looking at the new processors            01/01/70 00:00      
                              I once mentioned that ...            01/01/70 00:00      
                           It's not what I'd choose, but it is a matter of perefernce            01/01/70 00:00      
                              As flash gets bigger, the code steps do too.            01/01/70 00:00      
                              Still not needed for other architectures            01/01/70 00:00      
                                 We will have to agree to disagree ... I guess            01/01/70 00:00      
                                    Which single-clocker is cheaper than an ARM?            01/01/70 00:00      
                                       RE: Which single-clocker is cheaper than an ARM?            01/01/70 00:00      
                                       differs considerably from the classic microcontroller?            01/01/70 00:00      
                                       Horses for courses            01/01/70 00:00      
                                          Always start each project by scanning the market            01/01/70 00:00      
                                             On that we can agree            01/01/70 00:00      
                                          Maybe, but what are they comparing?            01/01/70 00:00      
                                             Did you actually look?            01/01/70 00:00      
                                                Yes, I did.            01/01/70 00:00      
                                       it's a tradeoff            01/01/70 00:00      
                                          Is it 2006 already?            01/01/70 00:00      
                                             Really?            01/01/70 00:00      
                                                that's outright silly            01/01/70 00:00      
                                                   Maybe ... which is why it is not yet the case            01/01/70 00:00      
                                                      the eyes of the beholder            01/01/70 00:00      
                                                         Look at it from another viewpoint for a moment            01/01/70 00:00      
                                          RE: I'm not the one to ask about IC prices            01/01/70 00:00      
                                             doesn't mean I'm totally in the dark            01/01/70 00:00      
                                                Richard Erlacher has left the planet            01/01/70 00:00      
                                                   Maybe Andy's the one who's lost            01/01/70 00:00      
                                                      I cannot believe you even looked at ARM            01/01/70 00:00      
                                                         It's all relative            01/01/70 00:00      
                                                            Price doesn't directly follow processor size            01/01/70 00:00      
                                                            What about performance?            01/01/70 00:00      
                                                         Be specific please.            01/01/70 00:00      
                                                            You can use your own supplier            01/01/70 00:00      
                                                               Your test simulates as 41.04us            01/01/70 00:00      
                                                                  RE: ARM compiles do not like byte-addressing            01/01/70 00:00      
                                                                     A typo on my part            01/01/70 00:00      
                                                                        Case of full unroll            01/01/70 00:00      
                                                                           ... and what does THAT ARM MCU cost?            01/01/70 00:00      
                                                                              WHO CARES            01/01/70 00:00      
                                                                                 Absolutely true!            01/01/70 00:00      
                                                                              $5 or lower            01/01/70 00:00      
                                                                                 My Simulation times were wrong.            01/01/70 00:00      
                                                                                    67% of your loop was your loop            01/01/70 00:00      
                                                                                    re-written the loop in C            01/01/70 00:00      
                                                                                       Try without loop counter            01/01/70 00:00      
                                                                                          You're right!            01/01/70 00:00      
                                                                                             Similar trick with ARM7 would require 66.67MHz            01/01/70 00:00      
                                                                                             60ns with no store instruction.            01/01/70 00:00      
                                                                                                25% speedup            01/01/70 00:00      
                                                                                                   Actually, I found the for loop faster.            01/01/70 00:00      
                                                                                                      Compiler setting?            01/01/70 00:00      
                                                                                                         I made NO optimisation            01/01/70 00:00      
                                                                                                            Avoid variable aliasing if you like high optimization levels            01/01/70 00:00      
                                                                                                               The RealView compiler is very competent            01/01/70 00:00      
                                                                                                                  Yes, caching            01/01/70 00:00      
                                                                                                                  Yes, caching            01/01/70 00:00      
                                                                                                It's much easier with the 8-bit single-clocker            01/01/70 00:00      

Back to Subject List