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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/25/09 21:14
Read: times


 
#169149 - How about table-lookup?
Responding to: ???'s previous message
Aakash Upadhyay said:
hi
i'm working on project switching the devices by GSM.

Could you, perhaps, provide more information about exactly what you mean by, "switching the devices"?

i have easy8051 kit from microelectronika with rs-232 port.

i want to know that how .asm code will work to interface with AT commands..i.e. when msg come from mobile to gsm modem how mc will know that a msg came and which action have to do according to that.

The simplest of microcontroller control functions can be expressed as, "examine inputs, take appropriate action." One very common such technique is "table lookup". With that strategy, you would receive the text string, tokenize it (meaning to reduce it to a single, unique, byte), and use the token as an offset into a table of addresses, with each address pointing to the appropriate routine. Keep in mind that the offset will point to a single location in the table, but that the location has to contain an address of 16-bit length. I suspect that will work with a single byte, as there are probably not more than 128 distinct actions you will need to take. The key is that you then use
MOVC @A+DPTR,
with DPTR initialized to the base of the table, and A containing the token, to transfer control to the appropriate routine.

This is not as simple as it may look, but it is a simple concept, and both easy to devise and easy to debug. If you think in terms of one routine for each desired action, that will lead you in the right direction.

and how mc will react after that.


Isn't this latter part entirely up to you? If you provide the code for the MCU, YOU determine how it will react.

RE


List of 14 messages in thread
TopicAuthorDate
Interface between GSM modem & 8051/52            01/01/70 00:00      
   Use the Search button...            01/01/70 00:00      
   How about table-lookup?            01/01/70 00:00      
      Cross-posting            01/01/70 00:00      
         That borders on nonsense!            01/01/70 00:00      
            Disagree (to a point)            01/01/70 00:00      
               'C' Vs 'Asm' "Please ! Not Again!!!"            01/01/70 00:00      
                  that will happen at every opportunity Richard sees            01/01/70 00:00      
                     I think Richard's point...            01/01/70 00:00      
                        It's not the language ... it's the approach            01/01/70 00:00      
                           The approach            01/01/70 00:00      
                              That's bottom-up, not top-down.            01/01/70 00:00      
               Investigation of "prior art" is what will solve the problem            01/01/70 00:00      
   how .asm code will work to intrface with AT commands            01/01/70 00:00      

Back to Subject List