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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/29/09 15:52
Read: times


 
#164935 - Clarification Needed
Responding to: ???'s previous message
Chico Magalhães said:

I was wanting to deal with 512 variables, but this is far to be possible because of 8051 ram, 256 also, 128 too, maybe 64 values, so I need to use the less memory possible.

Are you saying that you could use 512 steps? Does that mean that the input and output values could be greater than 255? Because that would be 16 bit values, these are not impossible with an 8051 but the coding is a little complex and is not something that 8051 opcodes handle natively. Having said that I should also say that just because an 8051 doesn't do it natively doesn't mean it shouldn't be done.

So, let's start like we would any project (or function, or single line of code).
Determine the input value range that is desired.
Determine how to handle out of range inputs, if you don't control the inputs (a.k.a. stupid user filter).
Scribble out some pseudo code that gives you the desired output for your inputs.
Determine how the outputs will be handled (all a once like unloading a buffer, or output-wait-output-wait).
This last step will tell you if you need to figure up all of the outputs values in one function. Or if your function can be called once for each step (this can use a surprisingly small amount of ram as long as the previous output values are no longer needed).

Once you have this information, the rest is really easy. It's just a matter of finding the best ASM instructions to match your pseudo code.

I'm curious, in your initial post you said "fade". Are you fading (dimming) an LED or something similar? Because human perception of light intensity is not linear.

List of 19 messages in thread
TopicAuthorDate
Values interpolation            01/01/70 00:00      
   A possible start            01/01/70 00:00      
      The Brezingham Line Drawing algorithm            01/01/70 00:00      
         http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm ?            01/01/70 00:00      
            Good method            01/01/70 00:00      
               Integer Digital Differential Analyzer            01/01/70 00:00      
   Simple scheme...            01/01/70 00:00      
      Further optimization            01/01/70 00:00      
         You are absolutely right, of course,...            01/01/70 00:00      
   Having a hard time trying to understand :(            01/01/70 00:00      
      Clarification Needed            01/01/70 00:00      
         Even more confused now            01/01/70 00:00      
            Another Shot            01/01/70 00:00      
               code            01/01/70 00:00      
                  Provided Code            01/01/70 00:00      
                     Maybe this            01/01/70 00:00      
                        Give this a try...            01/01/70 00:00      
            Look it up            01/01/70 00:00      
      Now, we have a hard time to understand...            01/01/70 00:00      

Back to Subject List