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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/10/06 18:02
Read: times


 
#127729 - and here's how
Responding to: ???'s previous message
Erik Malund said:
However, I wonder how you can deny that operating the MCU at full speed EXCEPT during external bus cycles will impact system performance much. I've already presented some numbers.

Ok, so 'every millisecond' you slow down the bus, not much in the scheme of things?

And what about a time critical interrupt?

Unless the time-critical ISR involves the particular I/O residing on the external bus, it will have no impact at all. If it does reside on the external bus, only a MOVX instruction will affect the timing. Keep in mind, that if you have multiple devices on the external bus, you need only ensure that the bus cycle is long enough to accomodate the slowest. If you have a requirement for LOTS of I/O to one set of peripheral hardware, you can consider making a timing adjustment dedicated to that set of hardware to the exclusion of others. You have to consider the consequences of that, however. Remember, though, that an SFR write can change the bus cycle length. If you have two bus speeds, and know which routines affect which hardware (which you should, as you're the guy writing the code) then there's no need to determine what the current SFR setting is. You simply set it, once, as needed when entering the code block and restore the default when you exit. When you subsequently enter a code block that requires a cycle length change, you can make the necessary change, so long as you do it prior to the MOVX instruction(s) that access the external bus region that requires it.

EVERY interrupt would need to add this:
test speed state state
if slow save and set high
do the isr
restore speed state

No, I don't think that's necessary at all. First of all, the ISR will only be affected in its timing during cycles to the external bus. IF you use the external bus-located hardware, then you must, of course, allow for the required time. However, if your time critical ISR doesn't involve the external bus, it will not be affected at all. Secondly, IF you DO need to operate I/O on the external bus as part of your ISR, and IF those external resources require a different bus speed, which is a rare condition, indeed, then a SFR writes are all that's needed to set the bus speed for that ISR. Naturally, you have to consider the effect of how you've designed your system. I imagine what youd have to do given the circumstance you propose, is

fetch the current SFR content to a register
set the appropriate SFR content (1 byte)
do the isr
restore the prior SFR content (1 byte)

However, it would be an unusual situation, indeed, to have to have two different bus-cycle lengths, possible and practical though it might be. I think this is among the rarest of situations. I think you're "reaching." Unless you actually do have devices requiring a choice of cycle length on the external bus, which would be extremely unusual, you'd simply have to know how long a MOVX instruction takes when you use it and allow for it in your time budget. In that case, your ISR would probably be more like


set the appropriate SFR content for the ISR (1 byte constant)
do the isr
set the appropriate SFR content for the main code body (1 byte constant)

Before you try to 'orange' this by suggesting an interrupt disable during slowpoke access, it would, in most apps be disatrous to disable interrupts duting the slowpoke access.

No, you certainly wouldn't want to disable interrupts. What you would want to do is to take into consideration that every access to the external bus, which, of which you as the programmer will be acutely aware, will have a duration different from access to internal resources. However, you'll know that, so you can make adjustments in your code.

Sometimes, the obvious (once every millisecond) is not where using the slowpoke will hit you.

Well, if you have a 1 ms interrupt, you have to take it into consideration in the ISR if it uses the external memory bus. In the case we were considering, the external hardware was limited to the external 8255's, though the same restrictions apply to any external LSI (FDC, HDC, USART, CRTC, etc.) hardware with access time restrictions that exceed the full-speed specified performance of the external bus.

another:
Since most "modern" MCU's have lots >>8KB of code storage on board, one would presume that there's more than one time-critical loop in use.

what if that 'time-critical loop' involves I/O would the slowpoke not upset that?

Erik

This all ties back to the basic architecture of the 805x. The only instructions that would be impacted by the firmware-controlled cycle stretch are MOVX instructions. If you don't use 'em you won't be affected. If you do, you'll know it, since you're the one doing the typing, and you simply have to allow the appropriate amount of time in your time budget.

PS; in the days when the king of diamonds were a jack I used the 8255 extensively, but progress happens.


Well, I never learned to like the 8255, or its Motorola equivalents because of their low output current. COnsequently, my primary use for the thing was on COTS boards where they'd been designed in.

RE


List of 142 messages in thread
TopicAuthorDate
New FAQ            01/01/70 00:00      
   all well and good            01/01/70 00:00      
      OK, "blinkey" there now :-)            01/01/70 00:00      
   Addedto FAQq            01/01/70 00:00      
      I'd call it...            01/01/70 00:00      
         Agreed            01/01/70 00:00      
            missing quotes            01/01/70 00:00      
               it's not a statement            01/01/70 00:00      
            appended            01/01/70 00:00      
   "bible"&co            01/01/70 00:00      
   Jon's RS232 tutorial            01/01/70 00:00      
   code not work            01/01/70 00:00      
   table lookup            01/01/70 00:00      
   ehanced outputs            01/01/70 00:00      
      and extended...            01/01/70 00:00      
         uln            01/01/70 00:00      
            Problem            01/01/70 00:00      
               This happened to me, too            01/01/70 00:00      
                  Bugs            01/01/70 00:00      
            FAQ updated: freewheeling diode            01/01/70 00:00      
   How do Quasi-Bidirectional I/O ports work?            01/01/70 00:00      
      ... and cross-linked...            01/01/70 00:00      
         Space            01/01/70 00:00      
            RE:Space            01/01/70 00:00      
            Would never do that            01/01/70 00:00      
               Might have to !            01/01/70 00:00      
         And criss-cross-linked...            01/01/70 00:00      
   added me own little bit            01/01/70 00:00      
   Does output logic "low" represent 0V?            01/01/70 00:00      
      Nice contribution!            01/01/70 00:00      
         but not new            01/01/70 00:00      
            ???            01/01/70 00:00      
               well, it got the blues            01/01/70 00:00      
                  Cheer up...            01/01/70 00:00      
                     but certainly not the first            01/01/70 00:00      
   device burning            01/01/70 00:00      
      Come on, Jan...            01/01/70 00:00      
         He, who does the work, makes the choices            01/01/70 00:00      
   level/edge interrupt            01/01/70 00:00      
   Added note on use of TABs            01/01/70 00:00      
   updated "code no work" FAQ            01/01/70 00:00      
   What will happen when I use an RC (or C only) rese            01/01/70 00:00      
      What reset ICs are good for '51s?            01/01/70 00:00      
         These things are not necessary ...            01/01/70 00:00      
            You've opened a can of worms now!            01/01/70 00:00      
            you do not use internal flash, do you?            01/01/70 00:00      
               it's broken            01/01/70 00:00      
            can of worms            01/01/70 00:00      
               Something interesting ...            01/01/70 00:00      
                  to reset or not to reset            01/01/70 00:00      
                     It's cheaper and easier to use the linear PSU            01/01/70 00:00      
                        then you better get a separate supply            01/01/70 00:00      
                           That's exactly correct!            01/01/70 00:00      
                              why don't they put in GOOD resets?            01/01/70 00:00      
                                 The RESET circuit on the Maxim/Dallas parts            01/01/70 00:00      
                              you are TOTALLY missing the point            01/01/70 00:00      
                                 rephrasing            01/01/70 00:00      
                                 depends on what your definition of "it" is            01/01/70 00:00      
                           battery            01/01/70 00:00      
                              I think we know enough ...            01/01/70 00:00      
                                 resets, power sources            01/01/70 00:00      
                                 answered above            01/01/70 00:00      
                        spec for RC            01/01/70 00:00      
                           I've heard that sort of thing before ...            01/01/70 00:00      
         My two cents            01/01/70 00:00      
   How to make a software UART?            01/01/70 00:00      
      comments and suggested additions            01/01/70 00:00      
         many thanks            01/01/70 00:00      
            revised revisions            01/01/70 00:00      
               OK            01/01/70 00:00      
   two "basic" faqs            01/01/70 00:00      
   external memory interfacing            01/01/70 00:00      
   how to expand ports            01/01/70 00:00      
      addition to IO FAQ            01/01/70 00:00      
         pretty good, here are comments            01/01/70 00:00      
            thanks            01/01/70 00:00      
               clarifications            01/01/70 00:00      
            it's there            01/01/70 00:00      
               you're forgetting too much!            01/01/70 00:00      
                  OK sorry            01/01/70 00:00      
                     It\'s just easier to type ...            01/01/70 00:00      
                        what about a 'such as'            01/01/70 00:00      
                           the downside is            01/01/70 00:00      
   "what's wrong with 8255" added            01/01/70 00:00      
      assumes facts not in evidence ...            01/01/70 00:00      
         effective?            01/01/70 00:00      
            not even YOU can deny that ...            01/01/70 00:00      
               well, so is a steamroller            01/01/70 00:00      
                  Just how much would it slow you down?            01/01/70 00:00      
                     well there goes central USA            01/01/70 00:00      
                     standard answer            01/01/70 00:00      
                        it's just another temper tantrum from Erik            01/01/70 00:00      
                           it is not the age it is the speed            01/01/70 00:00      
                              get real, Erik            01/01/70 00:00      
                                 if I did not need the speed, I would use a cheaper            01/01/70 00:00      
                                    what about the other 191 bits?            01/01/70 00:00      
                                       Where did I say ONE?            01/01/70 00:00      
                                          it's 192, not ONE            01/01/70 00:00      
                                             that is IMPOSSIBLE            01/01/70 00:00      
                                                Of course it is, but YOU changed the subject            01/01/70 00:00      
                                                   I had posted a lot then I found this            01/01/70 00:00      
                                                      Finally, I've got your attention!            01/01/70 00:00      
                                                         How does that you 'cite' something make it that I            01/01/70 00:00      
                                                            What do you mean by "speed," Erik?            01/01/70 00:00      
                                                               Gentlemen please            01/01/70 00:00      
                                                                  Yes, it's not pretty            01/01/70 00:00      
                                                                     should we just let such go by?            01/01/70 00:00      
                                                                        When you have no role            01/01/70 00:00      
                                                                           correct ?            01/01/70 00:00      
                                                                              but you still have to answer the question            01/01/70 00:00      
                                                                                 The best choice component should be chosen            01/01/70 00:00      
                                                                                    Not this time!            01/01/70 00:00      
                                                                                       Now once more you 'cite' and becuse I have not            01/01/70 00:00      
                                                                                          if the shoe fits ...            01/01/70 00:00      
                                                                                             Once again, you circumvent            01/01/70 00:00      
                                                                                                nope ...            01/01/70 00:00      
                                                                                                   A paradox            01/01/70 00:00      
                                                                                                      have you ever worked for the pointy haired boss            01/01/70 00:00      
                                                                                                      there's a time for everything            01/01/70 00:00      
                                                               here is why            01/01/70 00:00      
                                                                  and here's how            01/01/70 00:00      
                                                                     a trip down memory lane            01/01/70 00:00      
         the intended audience of the faqs are newbies...            01/01/70 00:00      
            but newbies aren't children, and you mustn't lie            01/01/70 00:00      
            EGAD! another double-post            01/01/70 00:00      
   New FAQ: debouncing            01/01/70 00:00      
      contributions to debouncing FAQ            01/01/70 00:00      
         Thanks            01/01/70 00:00      
   http://www.8052.com/faqs.phtml?FAQ=127612            01/01/70 00:00      
   doubt about maskable ROM            01/01/70 00:00      
      not to your advantage, i think            01/01/70 00:00      
   FAQ on ADC            01/01/70 00:00      
   while waiting for a needed device            01/01/70 00:00      
      I would add, that...            01/01/70 00:00      
         will add that in the next minute, thanks            01/01/70 00:00      
      nice!            01/01/70 00:00      
         My two cents and then sum            01/01/70 00:00      
   a good FAQ or other means would be            01/01/70 00:00      
      great idea, start it            01/01/70 00:00      
         you have been unamously by me voted to be            01/01/70 00:00      
            thanks            01/01/70 00:00      
   and one more            01/01/70 00:00      

Back to Subject List