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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/21/03 13:07
Read: times


 
#39654 - Interrupts on my 8052 are broken! (?)
I had started with an interrupt driven serial I/O routine that I got from www.pjrc.com. It didn't work for me out of the box, so I started reducing the code further and further until I ended up with:

.org 0x0023
ljmp uart_intr

.org 0x8000
clr ea
mov tmod,#0x20
mov th1,#0xfa
mov scon,#0x50
setb tr1
setb es
setb ea

loop:
sjmp loop

uart_intr:
jnb ri,xmit
mov a,sbuf
clr ri
xmit:
clr ti
mov sbuf,a
reti

While this program runs, there is a steady stream of ascii 0x41 (A) coming in on the serial port at 9600 baud. Before anyone asks, the serial communication is fine. It is 9600N81, and I use the same port to upload IHX files to a built-in monitor program on an EPROM on the dev board.

The above program sends absolutely nothing back on the serial port. At this point I am just guessing where to move lines around, and just trying different combinations of setb's and mov's. The way it is supposed to work, doesn't. Has anyone ever got serial interrupts to work? Seems like a silly question, but all the different things I have tried, leads me to believe that they do not.

thanks

List of 7 messages in thread
TopicAuthorDate
Interrupts on my 8052 are broken! (?)            01/01/70 00:00      
   RE: Interrupts on my 8052 are broken! (?)            01/01/70 00:00      
   RE: Interrupts on my 8052 are broken! (?)            01/01/70 00:00      
      RE: Interrupts on my 8052 are broken! (?)            01/01/70 00:00      
         RE: Interrupts on my 8052 are broken! (?)            01/01/70 00:00      
   RE: Interrupts on my 8052 are broken! (?)            01/01/70 00:00      
      thanks all            01/01/70 00:00      

Back to Subject List