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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Jan Waclawek
02/28/06 11:25
Modified:
  02/28/06 11:26

Read: 653 times
Bratislava
Slovakia


 
#110932 - bah...
Responding to: Jon Ledbetter's previous message
Jon Ledbetter said:

I tried to change this from 4 to 1
LOOP:
   LCALL GET_RX_NR
   CJNE  A,#4,MAIN_X2
and it worked for eight characters, but spits out a string of garbage after that.


Jon,

This just shows how stupid showoff I am.
It can't work properly EXCEPT the value of 4...
(This happened the same way in the "code competition" - Maarten Brock noticed the error in what I thought is perfect solution and for testing I chose one of the rare cases where it really worked...).
The trouble is in the calculation of how many characters are in the receive buffer - GET_RX_NR - in case the "head" is "below" the "tail" (head wrapped around but tail not) it shall not get the complement but shall add the size of buffer instead.
The corrected GET_RX_NR:
GET_RX_NR:
   CLR   C
   MOV   A,RX_HEAD
   SUBB  A,RX_TAIL
   JNC   GET_RX_NR_X1
   ADD   A,#RX_BUFF_END-RX_BUFF+1
GET_RX_NR_X1:
   RET
I will try to do the comments asap.

Jan Waclawek

List of 46 messages in thread
TopicAuthorDate
Feedback needed        Jon Ledbetter      12/12/05 13:29      
   Couple of ideas      Sasha Jevtic      12/12/05 14:24      
   Missing      Andy Neil      12/12/05 15:28      
      the source...      Jan Waclawek      12/12/05 16:10      
         Stupid EIA      Andy Neil      12/13/05 00:52      
      Maybe a Name change?      Jon Ledbetter      12/12/05 22:30      
         minor but annoying ...      Richard Erlacher      03/17/06 09:33      
   USB      Ian Bell      12/12/05 16:06      
      Limited Experience      Jon Ledbetter      12/12/05 22:43      
      known bad USB/serial      Jan Waclawek      12/13/05 01:56      
      FYI - Targus PA088      Jon Ledbetter      12/13/05 09:46      
   thoughts      Jan Waclawek      12/12/05 16:17      
      I am so stupid      Jan Waclawek      12/13/05 02:02      
         Kickstart      Jon Ledbetter      12/13/05 07:36      
   attribution      Steve M. Taylor      12/13/05 03:41      
   The ONE thing I always have to look up a      Erik Malund      12/13/05 08:03      
   Ok - Second revision, but still working,      Jon Ledbetter      12/15/05 14:16      
      Nice      Steve M. Taylor      12/15/05 15:12      
         OK      Jon Ledbetter      12/15/05 15:33      
         MAX202 vs. MAX232A      Jan Waclawek      12/16/05 02:32      
         or the 232A      Erik Malund      12/16/05 06:32      
      Polled; Interrupt      Andy Neil      12/16/05 00:39      
         polled tx      Jon Ledbetter      12/16/05 07:48      
            Assorted small ideas      Sasha Jevtic      12/17/05 00:19      
               Not a good idea      Kai Klaas      12/17/05 06:46      
                  Serial speeds?      Sasha Jevtic      12/17/05 08:41      
                     Enhanced specifications      Kai Klaas      12/18/05 06:38      
                        That's a strange spec      Sasha Jevtic      12/20/05 15:04      
      formal stuff      Jan Waclawek      12/16/05 02:59      
         formal      Jon Ledbetter      12/16/05 08:23      
            who's the intended audience      Jan Waclawek      12/16/05 09:15      
   3rd Revision      Jon Ledbetter      12/27/05 08:47      
      Busy?      Jon Ledbetter      01/03/06 12:23      
         more than a couple of comments...      Jan Waclawek      01/04/06 16:27      
            So.....      Jon Ledbetter      01/05/06 15:01      
               what I like or not...      Jan Waclawek      01/06/06 08:25      
                  comments      Jan Waclawek      02/28/06 05:18      
                     Comments on Comments      Jon Ledbetter      02/28/06 09:37      
                        bah...      Jan Waclawek      02/28/06 11:25      
                           more problems      Jan Waclawek      02/28/06 13:20      
                              RE: Problems      Jon Ledbetter      02/28/06 13:36      
                              Something Strange      Jon Ledbetter      02/28/06 13:57      
                                 Nope....      Jon Ledbetter      02/28/06 14:28      
                                    interrupt      Jan Waclawek      02/28/06 15:30      
   All members will enjoy      Ralph Sack      03/16/06 21:55      
   Intel serial intro app note      Sasha Jevtic      03/28/06 15:16      

Back to Subject List