English
Language : 

VMX1C1016 Datasheet, PDF (68/76 Pages) List of Unclassifed Manufacturers – Versa Mix 8051 Mixed-Signal MCU
VMX51C1016
TABLE 121: (PORTIRQSTAT) PORT CHANGE IRQ STATUS - SFR A1H
7
6
5
4
P17ISTAT P16ISTAT P15ISTAT P14ISTAT
3
P13ISTAT
2
P12ISTAT
1
0
P11ISTAT P10ISTAT
Bit Mnemonic
7
--
6
--
5
--
4
--
3
P13ISTAT
2
P12ISTAT
1
P11ISTAT
0
P10ISTAT
Function
Unused
Unused
Unused
Unused
Port 1.3 changed
0 = No
1 = Yes
Port 1.2 changed
0 = No
1 = Yes
Port 1.1 changed
0 = No
1 = Yes
Port 1.0 changed
0 = No
1 = Yes
FIGURE 44: APPLICATION EXAMPLE OF PORT CHANGE INTERRUPT
Numeric Keypad
123
P1.3
456
P1.2
789
*
0
#
P1.1
VMX51C1016
P1.0
P2.0
P2.1
P2.2
The following provides an assembler example
for configuration of the interrupt on Port 1 pin
change and how it is shared with the ADC
interrupt.
include VMIXreg.INC
;*** INTERRUPT VECTORS JUMP TABLE *
ORG 0000H
;BOOT ORIGIN VECTOR
LJMP
START
ORG 006BH
;INT ADC and P1 change interrupt
LJMP
INT_ADC_P1
;*** MAIN PROGRAM
ORG 0100h
START:
MOV
MOV
DIGPWREN,#01H
P2PINCFG,#0FFH
;ENABLE TIMER 2
;*** Initialise Port change interrupt on P1.0 - P1.7
MOV
PORTIRQSTAT,#00H
MOV
PORTIRQEN,#11111111B
;*** Initialise the ADC, BGAP, PGA Operation
MOV
ANALOGPWREN,#07h
;Select CH0 as ADC input + Enable input buffer + Adc clk
MOV
INMUXCTRL,#0Fh
MOV
ADCCLKDIV,#0Fh
MOV
ADCCONVRLOW,#000h
;*** configure ADC Conversion Rate
MOV
ADCCONVRMED,#080h
MOV
ADCCONVRHIGH,#016h
MOV
ADCCTRL,#11111010b
;***Activate All interrupts + (serial port for debugger support)
MOV
IEN0,#090H
;*** Enable ADC interrupt
MOV
IEN1,#020H
;***Wait IRQ…
WAITIRQ: LJMP
WAITIRQ
ORG 0200h
;************************************************************************
;* IRQ ROUTINE: IRQADC + P1Change
;************************************************************************
INT_ADC_P1:
;MOV
IEN0,#00h ;DISABLE ALL INTERRUPT
;***Check if IRQ was caused by Port Change
;***If PORTIRQSTAT = 00h -> IRQ comes from ADC
MOV
A,PORTIRQSTAT
JZ
CASE_ADC
;*** If interrupt was caused by Port 1, change
CASE_P0CHG:
MOV
PORTIRQSTAT,#00H
;*** Perform other instructions related to Port1 change IRQ
;(...)
;*** Jump to Interrupt end
AJMP
ENDADCP1INT
;*** If interrupt was caused by ADC
CASE_ADC:
ANL
ADCCTRL,#11110011b
;***Reset ADC interrupt flags & Reset ADC for next acquisition
ORL
ADCCTRL,#080h
ORL
ADCCTRL,#11111010b
;*** Perform other instructions related to Port1 change IRQ
;(...)
;** End of ADC and Port 1 Change interrupt
ENDADCP0INT:
ANL
IRCON,#11011111b
;***Enable All interrupts before exiting
; MOV
IEN0,#080H
RETI
END
_________________________________________________________________________________________________
www.ramtron.com
page 68 of 76