Continue to Site

# need help with some symbols in pic

Status
Not open for further replies.

##### Newbie level 5
hello every one
i am new in programing th PIC and i need some help with understanding the pic delay

i dont understand some symbols like $+1$+2 what dose $mean ??? and if there is any formula to mesur exact delay thank you so much #### andre_luis ##### Super Moderator Staff member$ is a compiler directive wich refers to actual code position.
Exact delay depends up to how many microinstructions were used at each instruction, and time lenght of each instruction.
At RISC cores is easier to calculate it.

Note that most of compilers performs that calculations during simulation...

+++

joseMiguel

### joseMiguel

Points: 2

#### jpanhalt

$+1 or$-1 (etc.) is also used to go forward or back, respectively, that number of steps. It can be useful with the "skip if" instructions, like btfsc.

John

joseMiguel

### joseMiguel

Points: 2

#### betwixt

##### Super Moderator
Staff member
But beware of a common mistake, it moves you that many addresses, not instructions on 16-bit core PICs, jumping +1 or -1 lands you half way through an instruction and wil probably cause a crash. It's much safer to use a label and 'goto' it so the assembler can work out the jump size for you.

Brian.

Points: 2

Points: 2

### bjuric

Points: 2

#### jpanhalt

Thanks, my experience is all 8-bit where it is sometimes even referred to as the program counter. When (if) I ever graduate to 16-bit, I will remember that difference.

John

#### bjuric

and if there is any formula to measure exact delay
In PIC, every instruction takes exactly one internal clock cycle (Fosc/4), except branching instructions (goto, btfss, btfsc...) which all take two internal cycles.

Status
Not open for further replies.