PIC12F629 programming

Thread Starter

forester

Joined Sep 20, 2010
1
Please help me solve this task, if possible send answers to e-mail <snip>

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

Rich (BB code):
#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
 
Last edited by a moderator:

debjit625

Joined Apr 17, 2010
790
Check out PIC12F629's Datasheet from Microchip's website.In datasheet you will find all the instruction's instruction cycles .

Good Luck
 
Top