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

Back to Subject List

Thread Closed: Issue successfully resolved

???
03/08/04 19:45
Read: times


 
#66285 - RE: I think this should be okay
Responding to: ???'s previous message
Deepak Kash wrote:
-------------------------------


okay now back to your queries
SERIAL: JNB TI,$

what will it do if TI not set, first thing unless TI is set ,since REN is disabled, no interrupt would occur and hence no ISR will be executed.
If still TI is not set it keeps looping the same add till it is set.
If ti set it goes to clear TI , yes as I write this I can reduce a cycle by using JBC TI,$


As you have enabled the serial interrupt, what will happen if you receive a character? You will enter your ISR and the TI-bit is NOT SET.

you wait forever until the TI-bit get's set, which is never as there was nothing to transmit.




Can you please ...Please make changes and send it back to me I am tired of going round the bush I need to complete my college project by 15th atleast give them a demo..

I have tried my level best . I am not doing the 'give me' thing but I have reached a limit of my understanding capacity...People have to tell me exactly what is wrong so I can further analyse and understand.


1) read, no, study the following info http://www.8052.com/tutint.ph...Interrupts

It says clearly:

Serial Interrupts are slightly different than the rest of the interrupts. This is due to the fact that there are two interrupt flags: RI and TI. If either flag is set, a serial interrupt is triggered. As you will recall from the section on the serial port, the RI bit is set when a byte is received by the serial port and the TI bit is set when a byte has been sent.

So what you have to do is: set up your pointers interrupts and the lot. If you want to start transmitting your main program (NOT your ISR) will have to fill the buffer wth chars and set the TI-flag. The tutorial says very clearly that If either flag (RI or TI) is set, a serial interrupt is triggered


Your ISR should check the TI-bit, if not set, return, else put char in sbuf and return.


If you want to test start with an isr like

check TI-bit
if clear RETI
else
move 'r' to sbuf
reti

above will only send 'r', nothing else...
if this works, try replacing the code for "move 'r' to sbuf" by the code for reading from a buffer


That's all I can do for now, as I cannot give you the actual code, I'm new at 8051 too...

and don't panic... you still have 7 days (and nights) if you need it by the 15th.

My advice: forget what you wrote, study the tutorial, and start again. It's better to "lose" two days learning the tutorial and bible. You will be more productive. Writing up the assembler code is the lesser part of programming. Make sure that _before_ you start you know what you need to know. (I mean the basic principles and basic info...).

regards
Patrick




List of 61 messages in thread
TopicAuthorDate
What is wrong in my serial comm prog            01/01/70 00:00      
   RE: What is wrong in my serial comm prog            01/01/70 00:00      
      RE: What is wrong in my serial comm prog            01/01/70 00:00      
         RE: What is wrong in my serial comm prog            01/01/70 00:00      
         RE: What is wrong in my serial comm prog            01/01/70 00:00      
            RE: What is wrong in my serial comm prog            01/01/70 00:00      
            You mean the ISR?            01/01/70 00:00      
   RE: What is wrong in my serial comm prog            01/01/70 00:00      
   RE: What is wrong in my serial comm prog            01/01/70 00:00      
      Deepak disappeared            01/01/70 00:00      
         RE: Deepak (dis)appeared            01/01/70 00:00      
            RE: Deepak (dis)appeared            01/01/70 00:00      
               The problem continues            01/01/70 00:00      
                  What I have understood till now            01/01/70 00:00      
                     RE: What I have understood till now            01/01/70 00:00      
                        RE: What I have understood till now            01/01/70 00:00      
                           Hans van Pelt & patrick de groote            01/01/70 00:00      
                           RE: What I have understood till now            01/01/70 00:00      
                           What is the problem now            01/01/70 00:00      
                           What is the problem now            01/01/70 00:00      
                              RE: What is the problem now            01/01/70 00:00      
                        Is this okay            01/01/70 00:00      
                           RE: Is this okay            01/01/70 00:00      
                              RE: Is this okay            01/01/70 00:00      
                              RE: Is this okay            01/01/70 00:00      
                                 RE: Is this okay            01/01/70 00:00      
                                    re:is this okay            01/01/70 00:00      
                                       RE: re:is this okay            01/01/70 00:00      
                                       RE: re:is this okay            01/01/70 00:00      
                                          I think this should be okay            01/01/70 00:00      
                                             RE: I think this should be okay            01/01/70 00:00      
                                                RE: I think this should be okay            01/01/70 00:00      
                                                   RE: I think this should be okay            01/01/70 00:00      
                                                   RE: I think this should be okay            01/01/70 00:00      
                                                      RE: I think this should be okay            01/01/70 00:00      
                                                      RE: I think this should be okay            01/01/70 00:00      
                                                         RE: I think this should be okay            01/01/70 00:00      
                                                            I will wait for my victory            01/01/70 00:00      
                                                               RE: I will wait for my victory            01/01/70 00:00      
                                                                  RE: I will wait for my victory            01/01/70 00:00      
                                                                     RE: I will wait for my victory            01/01/70 00:00      
                                                                     RE: I will wait for my victory            01/01/70 00:00      
                                                                        RE: I will wait for my victory            01/01/70 00:00      
                                                                           RE: your hardware            01/01/70 00:00      
                                                                        RE: I will wait for my victory            01/01/70 00:00      
                                                                     RE: I will wait for my victory            01/01/70 00:00      
                                                               RE: I will wait for my victory            01/01/70 00:00      
                                                                  RE: I will wait for my victory            01/01/70 00:00      
                                                                     I will be the victor soon            01/01/70 00:00      
                                                                        Protect dptr            01/01/70 00:00      
                                                                           RE: Protect dptr            01/01/70 00:00      
                                                                        RE: I will be the victor soon            01/01/70 00:00      
                                                                     RE: I will wait for my victory            01/01/70 00:00      
                                                                        RE: I will wait for my victory            01/01/70 00:00      
                                 RE: Is this okay            01/01/70 00:00      
                                    RE: Is this okay            01/01/70 00:00      
                                       RE: Is this okay            01/01/70 00:00      
                                    RE: Is this okay            01/01/70 00:00      
                                       RE: Is this okay            01/01/70 00:00      
                                       RE: Is this okay            01/01/70 00:00      
   close this discussion            01/01/70 00:00      

Back to Subject List