I am just learning to program in assembly using the 8051 microcontroller, and I am working on a simple Jeopardy-style project in which I have two clickers and a reset button, and one of two LED lights turns on depending upon which clicker is clicked first.
I am writing the program for this using interrupts, so the reset button is the input for INT0, clicker A is the input for INT1, and clicker B is the input for INT3. (I went with INT3 rather than INT2 so that they would all be negative-edge triggered). I'm simulating my program on RIDE7, but I found that whenever I simulate an interrupt on INT3, I get stuck in a state in which the INT3 interrupt perpetually occurs. I figured out that this is because the flags associated with INT0 and INT1 are automatically reset after those interrupts occur, but the flag associated with INT3 is NOT reset.
According to the High Speed Microcontroller User Guide (attached), this flag is named IE3, and its description reads: "This bit will be set when a falling edge is detected on INT3. This bit must be cleared manually by software." (see p. 28) The problem is, I cannot for the life of me figure out how to clear it manually by software. In the Interrupt Summary Table 9-1 of the same guide (p. 107), it says that IE3 is located at bit 5 of the EXIF register.
So in my program I issued the instruction CLR EXIF.5 . Unfortunately, this generates the following error: INVALID BYTE BASE IN BIT ADDRESS EXPRESSION. I have also tried using the address of the EXIF register, so that the instruction is CLR 91h.5 ...and this still gives exactly the same error. I have also tried MOV EXIF.5, #0 . Nothing works. Any help would be much appreciated. Thanks in advance.
I am writing the program for this using interrupts, so the reset button is the input for INT0, clicker A is the input for INT1, and clicker B is the input for INT3. (I went with INT3 rather than INT2 so that they would all be negative-edge triggered). I'm simulating my program on RIDE7, but I found that whenever I simulate an interrupt on INT3, I get stuck in a state in which the INT3 interrupt perpetually occurs. I figured out that this is because the flags associated with INT0 and INT1 are automatically reset after those interrupts occur, but the flag associated with INT3 is NOT reset.
According to the High Speed Microcontroller User Guide (attached), this flag is named IE3, and its description reads: "This bit will be set when a falling edge is detected on INT3. This bit must be cleared manually by software." (see p. 28) The problem is, I cannot for the life of me figure out how to clear it manually by software. In the Interrupt Summary Table 9-1 of the same guide (p. 107), it says that IE3 is located at bit 5 of the EXIF register.
So in my program I issued the instruction CLR EXIF.5 . Unfortunately, this generates the following error: INVALID BYTE BASE IN BIT ADDRESS EXPRESSION. I have also tried using the address of the EXIF register, so that the instruction is CLR 91h.5 ...and this still gives exactly the same error. I have also tried MOV EXIF.5, #0 . Nothing works. Any help would be much appreciated. Thanks in advance.
Attachments
Last edited: