This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The AT89LP214, register ACSR is deactived, i now reason.

Hello good day: I work with an AT89LP214, and I use the operational one, I get the impression that the ACSR register is disabled in the Keil_5 compiler, does anyone have any suggestion of the reason that the CF flag does not fire? Thanks

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
;      SI PULSAMOS P1.0 TENEMOS UNA ONDA CUADRADA
;         CONTROLADA POR EL FLAG DE SU TMR DE <1 kHz>
;           LA RUTINA LIMPIA LA BANDERA TF1    
;  
; Cuando pongo a 0 (P3.3) INT1 , Salida de cuadra onda.
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

$NOMOD51

		
$INCLUDE (C:\keil_v5\c51\INC\Atmel\AT89LP214.H)		

			USING	00
			ORG		0x00
			ORG		0x013
			ACALL	CUADRADA0
			ORG		0x033
			CLR		CF			
			ACALL	CUADRADA1
				
			MOV		IE,#11000101B		// IE (EA+TMR0+)	          || EA + EX0 = EN
			MOV		TMOD,#00000010B		// TMOD   | (13 bits)                  
			MOV		TCON,#00000000B		// TCON - START/STOP TMRs	  || FLANCO	BORRA AUTO
			
			MOV		P1M1,#00000000B
			MOV		P1M0,#00000011B
			
			ANL		0x097,#00001000B; ACSR
			
			ORL		0x09B,#00001000B; CEN
		

CUADRADA0:	SETB	P1.6
			ACALL	TIEMPO1
			CLR		P1.6
			ACALL	TIEMPO1
REARMA0:  	JNB		IE0,REARMA0			// Captura IRQ (P3.3)
			DJNZ	0FFH,CUADRADA0
			RETI
		
CUADRADA1:	SETB	P1.4
			ACALL	TIEMPO1
			CLR		P1.4
			ACALL	TIEMPO1
REARMA1:	JNB		AIN1,REARMA1			// Captura IRQ (P3.3) 0x9C AIN1
			DJNZ	0FFH,CUADRADA1
			
			MOV		A,#0x090			// IMPORTANTE HACE MASCARA (P1+A)
			ANL		A,#P1				// REGISTRO TRABAJO || ORL ||  MEMORIZA
			MOV		P3,A			
			
			RETI

TIEMPO1:	MOV		TH1,#0FFH
			MOV		TL1,#TH1
			SETB	TR1
REARME1:	JNB		TF1,REARME1			// Rearma FLAG TMR_0
			CLR		TF1
			CLR		TR1

			RET


			END

  • I get the impression that the ACSR register is disabled in the Keil_5 compiler

    ACSR = Analog Comparator Control & Status Register - it's a part of the silicon hardware; how could it be "disabled" by the compiler?

    any suggestion of the reason that the CF flag does not fire?

    The datasheet tells you the conditions which are necessary for the flag to "fire".  If the flag is not "firing", then you are not meeting those conditions.