EN:A microcontroller is a small computer on a single
integrated circuit containing a processor core, memory, and
programmable input/output peripherals. PIC 12F629 is small
microcontroller developed by Microchip. Program for it can have
only 35 single word instructions. Each instruction execution can
take one or two instruction cycle (more information can be easily
found on official
homepage).
To get cache coordinates You need to analyze the following program
listing and find the following:
A – number of instruction cycles for EastLoop block
B – number of instruction cycles for NordLoop block
C – number of times diod connected to 6th pin will light
on
D – is equal to number A without first and last digit (e.g.
if A=12345, D=234)
E – is equal to number B without first and last digit (e.g.
if B=1234, E=23)
You will find the cache at 56 42.CE; 23 47.D (e.g. if C=1, D=234,
E=23 then 56 42.123; 23 47.234)
LV: Mikrokontrollers ir mazs vienas integretas shemas
dators, kas satur procesora kodolu, atminu un programmejamas
ieejas/izejas. PIC 12F629 ir mazs Microchip ražots
mikrokontrollers. Programma tam var sastavet tikai no 35 komandam.
Katras komandas izpildišana var prasit vienu vai divus
izpildes ciklus (vairak informacijas var palasit oficialaja
majas lapa ).
Lai atrast slepna koordinates Jums ir nepieciešams
izanalizet zemakesošo programmas tekstu un atrast
sekojošo:
A – ciklus skaits, kas nepieciešams bloka EastLoop
izpildei
B – ciklus skaits, kas nepieciešams bloka NordLoop
izpildei
C – cik reizes iedegsies diods, kurš tiek pieslegts
pie 6. mikrokontrollera kajinas
D – ir vienads skaitlim A bez pirma un pedeja cipara (piem.
ja A=12345, tad D=234)
E – ir vienads skaitlim B bez pirma un pedeja cipara (piem.
ja B=1234, tad E=23)
Cache atrodas 56 42.CE; 23 47.D (piem. ja C=1, D=234, E=23 tad 56
42.123; 23 47.234)
#include
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF)
cblock 0x20
Delay1
Delay2
Delay3
endc
org 0
Start:
bsf STATUS,RP0
clrf TRISIO
bcf STATUS,RP0
clrf Delay1
clrf Delay2
clrf Delay3
movlw 0xD0
movwf B'100000'
movlw .7
movwf CMCON
MainLoop:
bsf GPIO,GP1
bsf 0x21,5
EastLoop:
nop
decfsz Delay1,f
goto EastLoop
decfsz Delay2,f
goto EastLoop
movwf Delay3
bcf 0x05,1
bsf 0x05,4
decf Delay3,0
bsf 0x20,7
bsf 0x20,3
bsf O'40',1
comf .32,1
NordLoop:
decfsz Delay1,f
goto NordLoop
btfsc GPIO,GP1
goto SetStep
bsf GPIO,GP1
goto SetSStep
SetStep:
bcf GPIO,GP1
SetSStep:
decfsz Delay3,f
goto NordLoop
bcf 0x05,1
bcf 0x05,4
end
EN:Cache contains log book, pencil, diode, resister,
wires, battery and PIC12F629 programmed using code above, but with
longer cycles, to be able to see time intervals
LV:Cache satur logbook, zimuli, gaismas diodi, rezistoru,
batarijas un PIC12F629 ieprogrammetu ar augstak esošo koda
gabalu, tikai ar ilgakiem izpildies cikliem, lai rezultatu varetu
redzet