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

Back to Subject List

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

Read: times


 
#110932 - bah...
Responding to: ???'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            01/01/70 00:00      
   Couple of ideas            01/01/70 00:00      
   Missing            01/01/70 00:00      
      the source...            01/01/70 00:00      
         Stupid EIA            01/01/70 00:00      
      Maybe a Name change?            01/01/70 00:00      
         minor but annoying ...            01/01/70 00:00      
   USB            01/01/70 00:00      
      Limited Experience            01/01/70 00:00      
      known bad USB/serial            01/01/70 00:00      
      FYI - Targus PA088            01/01/70 00:00      
   thoughts            01/01/70 00:00      
      I am so stupid            01/01/70 00:00      
         Kickstart            01/01/70 00:00      
   attribution            01/01/70 00:00      
   The ONE thing I always have to look up a            01/01/70 00:00      
   Ok - Second revision, but still working,            01/01/70 00:00      
      Nice            01/01/70 00:00      
         OK            01/01/70 00:00      
         MAX202 vs. MAX232A            01/01/70 00:00      
         or the 232A            01/01/70 00:00      
      Polled; Interrupt            01/01/70 00:00      
         polled tx            01/01/70 00:00      
            Assorted small ideas            01/01/70 00:00      
               Not a good idea            01/01/70 00:00      
                  Serial speeds?            01/01/70 00:00      
                     Enhanced specifications            01/01/70 00:00      
                        That's a strange spec            01/01/70 00:00      
      formal stuff            01/01/70 00:00      
         formal            01/01/70 00:00      
            who's the intended audience            01/01/70 00:00      
   3rd Revision            01/01/70 00:00      
      Busy?            01/01/70 00:00      
         more than a couple of comments...            01/01/70 00:00      
            So.....            01/01/70 00:00      
               what I like or not...            01/01/70 00:00      
                  comments            01/01/70 00:00      
                     Comments on Comments            01/01/70 00:00      
                        bah...            01/01/70 00:00      
                           more problems            01/01/70 00:00      
                              RE: Problems            01/01/70 00:00      
                              Something Strange            01/01/70 00:00      
                                 Nope....            01/01/70 00:00      
                                    interrupt            01/01/70 00:00      
   All members will enjoy            01/01/70 00:00      
   Intel serial intro app note            01/01/70 00:00      

Back to Subject List