| ??? 05/02/03 22:26 Read: times |
#44730 - Extern. interrupts do not work |
Hello, I cannot start my code working properly despite it was functioning OK 2 month ago. The EXT1 interrupt starts working only 6 minuties (in average) after reset. Until this time it is ignored, i.e. pulling the P3.3 low do not interrupt the MCU. Let me start with the code that demonstrates the problem.
; data declarations del0 DATA 030H del1 DATA 031H del2 DATA 032H ORG 00H JMP start ORG 13H ; External 1 service routine INC P0 ; increment p0 value to demonstrate work of the routine and count external events RETI ORG 40H ; program start start: ;initialization of the INT1 switching ;switch external intr mode from P3.3 to OR of PORT2 (tusb3210 feature) ; MOV P3, #0 ; MOV DPH, #0FFh ; XINT = 1 (OR of PORT2) ; MOV DPL, #90h ; MOVX A, @DPTR ; ORL A, #64 ; MOVX @DPTR, A ; INT1 interrupt initialization ; SETB IT1 ; edage triggered INT1 CLR IT1 ; level triggered INT1 SETB EX1 ; enable PORT2 OR SETB EA ; enable interrupts ; reset p0; it will be incremented ; with each interrupt MOV P0, #0 ; flash at p3 demonstrating activity flash: ; wait for a second MOV del2, #32 dl1: MOV del1, #0 dl0: MOV del0, #0 djnz del0, $ djnz del1, dl0 djnz del2, dl1 ; flash diodes at p3 MOV A, P3 CPL A MOV P3, A jmp flash ; flash diodes infinitely END Pulling a pin P3.3 to logic low interrupts the MCU (hat is expressed in slowing the flashing down at P1 and counter at P0 starts incrementing. THese effects of interrupt are observed only after 6 minuties after reset is elapsed. As you can see there is nothing in the flashing loop that can turn interrupts on. Edge-triggered interrupts are ignored also. I'm using TUSB3210. This MCU has a feature of switching interrupt source from P3.3 to OR of P2 pins, i.e. when one of these pins is in logic low state the MCU is interrupted. Misteriously, this feature starts interrupting MCU with the same 6 min. delay. Where is this 6 minute delay comes from? All other interrupts (serial and timer) work OK. |



