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

Back to Subject List

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


 
#156974 - look at str_len carefully
Responding to: ???'s previous message
Dear George,

have a look at str_len variable carefully.

str_len++; in serial isr

and


  while(1)
  {	
    if(data_ready)
	{
	  data_ready = 0;
	  if(my_string[str_len--] == 0xaa)




Now considor when you store first char and increase str_len in serial isr.

By the time next char arrives and serial interrupt appears; how many times if(data_ready) would have been executed. and what would be the value of str_len at that time?

Can u visualise the situation

Regards,
Mahesh

List of 37 messages in thread
TopicAuthorDate
Atmel AT89C52 serial port problems            01/01/70 00:00      
   Problem with Serial Port 89C52            01/01/70 00:00      
      Can't be            01/01/70 00:00      
      ATMEL AT89C52 Help?            01/01/70 00:00      
         Why are you considering a discontinued chip?            01/01/70 00:00      
         THIS POST IS IRRELEVALENT TO THIS TOPIC            01/01/70 00:00      
   Seven Hertz            01/01/70 00:00      
      Don't think so            01/01/70 00:00      
   post the whole code...            01/01/70 00:00      
      Pretty much the whole thing - I can add this tho            01/01/70 00:00      
         no main?            01/01/70 00:00      
            It's pretty much what I showed you - here you go.            01/01/70 00:00      
               how do you know WHAT does matter?            01/01/70 00:00      
               how do you use timer0?            01/01/70 00:00      
                  this will be most probably the culprit            01/01/70 00:00      
                     So what you're saying is            01/01/70 00:00      
                        Its timer0 interrupt making trouble            01/01/70 00:00      
                           I dont get it            01/01/70 00:00      
                              none, if            01/01/70 00:00      
                                 funny..            01/01/70 00:00      
                        timer 1            01/01/70 00:00      
                           this IS the program (everything I've posted)            01/01/70 00:00      
   Results + Complete program            01/01/70 00:00      
      evidently you do not blieve in making code readabl            01/01/70 00:00      
         Actually,            01/01/70 00:00      
            double post, please ignore            01/01/70 00:00      
            try a search            01/01/70 00:00      
      Ident Code, Suggestions in many /////////            01/01/70 00:00      
         Question            01/01/70 00:00      
            setting TMOD            01/01/70 00:00      
               24MHz            01/01/70 00:00      
               Done!            01/01/70 00:00      
   NEW - Receiver Promlems            01/01/70 00:00      
      be more specific            01/01/70 00:00      
         A few answers            01/01/70 00:00      
      Got something but still not entirely fixed            01/01/70 00:00      
      look at str_len carefully            01/01/70 00:00      

Back to Subject List