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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/13/09 20:17
Read: times


 
#161500 - To Hans
Responding to: ???'s previous message
Hans Van Pelt said:
while in the main loop you wait (beugh!) for TI to come on (actually you have that line commented out) and then you transmit a byte.

I tried moving that line to the ISR, and I tried uncommenting the line in the main loop. It doesn't make a difference.


Hans Van Pelt said:

Proper interrupt driven serial transmission would look more like this:
Trans: 
	CLR TI		; clear transmission flag for next trans
        clr a
        movc a,@a+dptr	; get character
        jz exitISR	; stop if char = null
        mov SBUF,A  	;

        inc dptr	; point to next char
 

What happens when I want to send just one byte? What happens when the byte does not come from code memory?

Hans Van Pelt said:


Also, you have a massive flow problem! Your code goes:
- reset,
- init,
- call send message, (stack contains return address)
- (send message executes and returns), (stack is empty now)
- return.
The final return will return to a garbage address, as the stack will be empty at that point. You need a proper termination. My "favourite time waster" does that, at reduced energy consumption too.


This is just a test file to insure that I am not losing my mind!
How is the stack empty when it returns? I don't understand.
1. After initialization, there is a call to the test routine.
2. In that routine there is another call to the OutStr routine and once finished it will return to the previous routine (test) which also includes a return instruction.
3. It then returns to the "jmp $" instruction which is an endless loop.

Maybe I am missing something here?
I realize that this is a foolish statement,
but it worked in the simulator!



List of 23 messages in thread
TopicAuthorDate
serial interrupt?            01/01/70 00:00      
   Your Problem            01/01/70 00:00      
      still not working            01/01/70 00:00      
         you need to flag somehow the end of transmission            01/01/70 00:00      
            reply to Jan            01/01/70 00:00      
   Several            01/01/70 00:00      
      To Hans            01/01/70 00:00      
         And my reply to Charles            01/01/70 00:00      
   no interrupts works            01/01/70 00:00      
   the solution            01/01/70 00:00      
      Isn't that what Hans said?            01/01/70 00:00      
      Perfectly????? Prolly should look again.            01/01/70 00:00      
         Got to look ahead...            01/01/70 00:00      
         Another thing to consider            01/01/70 00:00      
            reply to Andy Neil            01/01/70 00:00      
         reply to Michael Karas            01/01/70 00:00      
      why is this a bad idea            01/01/70 00:00      
         Exactly why not perfect !!!            01/01/70 00:00      
         response to Jan Waclawek            01/01/70 00:00      
            interrupts forever            01/01/70 00:00      
            nope            01/01/70 00:00      
               Re: Erik            01/01/70 00:00      
   if you HAVE to mix ...            01/01/70 00:00      

Back to Subject List