209
MC95FG308 / MC95FG208
ABOV Semiconductor Co., Ltd.
B. Instructions on how to use the input port
•
Error occur status
Using compare jump instructions with input port, it could cause error due to the timing conflict inside the
MCU.
Compare jump Instructions which cause potential error used with input port condition:
JB
bit, rel
; jump on direct bit=1
JNB
bit, rel
; jump on direct bit=0
JBC
bit, rel
; jump on direct bit=1 and clear
CJNE
A, dir, rel ; compare A, direct jne relative
DJNZ
dir, rel
; decrement direct byte, jnz relative
It is only related with Input port. Internal parameters, SFRs and output bit ports don’t cause any error by
using compare jump instructions.
If input signal is fixed, there is no error in using compare jump instructions.
•
Error status example
•
Preventative measures (2 cases)
Do not use input bit port for bit operation but for byte operation. Using byte operation instead of bit
operation will not cause any error in using compare jump instructions for input port.
zzz:
MOV A, 080 ; read as byte
JNB 0E0.0, xxx ; compare
SETB 088.0
SJMP yyy
xxx: CLR 088.0
yyy: MOV C,088.1
CPL C
MOV 088.1,C
SJMP zzz
while(1){
if ((P0&0x01)==0x01)
{ P10=1; }
else { P10=0; }
P11^=1;
}
MOV R7, #000
JB 080.0, xxx ; it possible to
be error
MOV R7, #001
xxx: RET
unsigned char ret_bit_err(void)
{
return
!P00
;
}
zzz:
JNB 080.0, xxx ; it possible to be
error
SETB 088.0
SJMP yyy
xxx: CLR 088.0
yyy: MOV C,088.1
CPL C
MOV 088.1,C
SJMP zzz
while(1){
if (P00==1)
{ P10=1; }
else { P10=0; }
P11^=1;
}
Содержание MC95FG208 Series
Страница 14: ...14 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd 4 Package Diagram Figure 4 1 32 Pin SOP Package...
Страница 15: ...15 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 2 32 Pin QFN Package...
Страница 16: ...16 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 3 32 Pin LQFP Package...
Страница 17: ...17 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 4 28 Pin SOP Package...
Страница 18: ...18 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 5 28 Pin SOP Package continue...
Страница 19: ...19 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 6 28 Pin SOP Package...
Страница 20: ...20 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 7 28 Pin TSSOP Package...
Страница 21: ...21 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 8 20 Pin SOP Package...
Страница 22: ...22 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 9 20 Pin TSSOP Package...
Страница 23: ...23 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 10 16 Pin SOP Package...
Страница 24: ...24 MC95FG308 MC95FG208 ABOV Semiconductor Co Ltd Figure 4 11 16 Pin TSSOP Package...