PDA

View Full Version : Serial Port Interupt Not Firing!


lboggs
07-01-01, 03:33 PM
Hello everyone! I am a student taking a Microcontrollers class. We are using the NMIY0031 development kit.

I am trying to run the following code just to get the Serial Port Interupt to fire when I press a key on my PC's keyboard, but it is not firing. Anyone see an error with this code?

.org 8023h
ljmp SPISR
.org 8100h
;************************************
mov ie,#90h
Again: sjmp Again
;************************************
SPISR: mov a,sbuf
clr ri
cpl p1.0
reti

I am able to get the Timer interupts to fire and I also know the "ri" flag is toggled when I press a key by running the following code:

.org 8100h
Main: lcall GetChar
sjmp Main
;*******************************
GetChar: jnb ri,GetChar
mov a,sbuf
clr ri
cpl p1.0
ret

Any input would be greatly appreciated.

Thanks,

Larry Boggs