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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/23/06 10:34
Modified:
  06/23/06 10:37

Read: times


 
#118932 - Problem solved. Really?
Responding to: ???'s previous message
The way you have solved your problem is horrible (that DELAY routine is unelegant). You want to manage the serial port via interrupts but only regarding reception, not transmission. The point is that the 8051 family has only one vector: serial port (as a whole), and not two (serial port, reception, and serial port, transmission). If you want to manage serial reception via interrupt then you have to filter out the serial transmision. The point is that you have to keep record of that event (a character has been sent out and the port hardware is ready for another one) so that the "normal" software (running in foreground) can detect it and send another one. This is extremely easy: define and use a copy of TI flag (call it PSEUDO_TI or whatever you like, and place it in the bit-addressable area of the internal RAM). So, you can build up an intrerrupt service routine looking like this:

SERIAL_PORT_SERVICE:
JBC RI,RECEPTION ;¿reception?
SETB PSEUDO_TI ; No: end of transmission. Keep record of TI flag
CLR TI
RETI
RECEPTION:
(...)

Then, the software in foreground can be written this way:
(...)
JNB PSEUDO_TI,$ ; forget about TI flag and use its soft copy
CLR PSEUDO_TI
(...)

List of 29 messages in thread
TopicAuthorDate
PC sending Not Received at MCU            01/01/70 00:00      
   pin numbers are meaningless ...            01/01/70 00:00      
   back to the roots            01/01/70 00:00      
      Sorry, All helper            01/01/70 00:00      
         as usual            01/01/70 00:00      
            PACKAGES            01/01/70 00:00      
               Oscillator Speed            01/01/70 00:00      
                  Oscillator is 11.0592MHZ            01/01/70 00:00      
               PACKAGES            01/01/70 00:00      
               DB9 is probably not what you use!            01/01/70 00:00      
   Use terminal program            01/01/70 00:00      
   if PC send nothing you should get 'LLLLL            01/01/70 00:00      
      'LLLL' untill PC send something            01/01/70 00:00      
   Pinnacle 52            01/01/70 00:00      
      Yes, Its working in Pinnacle52            01/01/70 00:00      
         Did you try with a terminal program?            01/01/70 00:00      
            Terminal program......            01/01/70 00:00      
               No need ... now.            01/01/70 00:00      
   Try this            01/01/70 00:00      
   the solution            01/01/70 00:00      
      which I'm sure you would if it had been            01/01/70 00:00      
      But why it still bursting 'LLLLLLLLLL.."            01/01/70 00:00      
         problem solved...Question is still there            01/01/70 00:00      
            Question is still there and comments are            01/01/70 00:00      
               which question?            01/01/70 00:00      
                  posted by Ali jus above - no comments            01/01/70 00:00      
                     details            01/01/70 00:00      
            Problem solved. Really?            01/01/70 00:00      
               Oh yes,Delay is just for testing            01/01/70 00:00      

Back to Subject List