Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need help with some symbols in pic

Status
Not open for further replies.

gladtor_455

Newbie level 5
Newbie level 5
Joined
May 16, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
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
 

$ 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...

+++
 
$+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
 
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.
 
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
 

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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top