Vous êtes sur la page 1sur 2

***File ini adalah file catatan yang boleh di modifikasi***

Interupt configuration
--------------------------------------------------------------------------------
IE= EA - - ES : ET1 EX1 ET0 EX0 =>ETx=timer; EXx interupt
at reset IE = 0xx0:0000

IP= - - - PS : PT1 PX1 PT0 PX0


at reset IP = xxx0:0000

TCON= TF1 TR1 TF0 TR0 : IE1 IT1 IE0 IT0


=>TFx=timer flag (hardware); TRx=ON/OFF timer (software)
IEx=Intx flag (hardware)=>ITx=0=>low level;ITx=1=>falling edge
at reset TCON = 0000:0000

TMOD= Gate C/T' M1 M0 : Gate C/T' M1 M0


for tim1 for tim0
Gate=1=> Counter/Timer will stop if INTx pin=0 and run if otherwise
the pre condition is TRx=1
at reset TMOD = 0000:0000
-------------------------------------------------------------------------------
arithmatic flag
cjne: carry flag =1 if op1 is smaller then op2
other wise carry flag=0

mul: OV = 1 when AxB >FFH , carry is always 0

div: OV = 1 if B hold 0 before division

signed additon and subtraction:


if OV=1 so complement the sign bit, it's also indicating that
the result is greater than byte can hold
-------------------------------------------------------------------------------
note about a-x and a+(-x)

a-x : carry -> a<x no carry -> a>=x |=> carry -> a<x no carry a>=x
a+(-x): carry -> a>=x no carry -> a<x |=> no carry -> a<x carry a>=x

so,all we have to do is switch jc with jnc and vice versa

-------------------------------------------------------------------------------
PSW = 1 1 1 1 1 1 1 1
| | | | | | | |-> Parity
| | | | | | |---> Reserved, but you can use it
| | | | | |-----> OV
| | | |--|-------> Register Bank
| | |------------> F0
| |--------------> AC
|----------------> Carry

-------------------------------------------------------------------------------
SCON= 1 1 1 1 1 1 1 1
| | | | | | | |-> RI, receive flag
| | | | | | |---> TI, transmite finish flag
| | | | | |-----> RB8, receive bit 8 at modes 2&3, stop bit at mode 1,

| | | | | not used by mode 0


| | | | |-------> TB8, transmited bit 8, set/clear by program at mode
2&3
| | | |----------> REN, receive enable
| | |------------> SM2, Multiprocessor comm bit in mode 2&3:
| | if set, interupt is generated when bit 9 is 1
| | no interupt is generated if bit 9 is 0
| | in mode 1:
| | if set, no interupt is generated unless stop
bit is valid
| | in mode 0, it must be cleared
| |--------------> SM0-
|----------------> SM1-> SM0 and SM1 together determine comm mode

To double baudrate, set bit 7 of PCON (87H)

-------------------------------------------------------------------------------
DOuble dptr is dpl=82H and dph=83H when AUXR1 (0A2H) bit 0 is 0, otherwise
dptr is dp1l=84H and dp1h=85H.
-------------------------------------------------------------------------------
WMPort = WM_USER+10 ( 1034 ) -> LParam=Port Number; Data pada WParam
WMCommMessage = WM_USER+11 ( 1035 ) -> Data pada WParam

Conector:Paralel
1.GND(20) 2.VCC(40) 3.Reset(9) 4.SCK(8) 5.MISO(7) 6.MOSI(6)

Vous aimerez peut-être aussi