Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

need help with some symbols in pic

Status
Not open for further replies.

gladtor_455

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
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,181
Helped
1,140
Reputation
2,299
Reaction score
1,116
Trophy points
1,403
Location
Brazil
Activity points
53,324
$ 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...

+++
 

jpanhalt

Advanced Member level 3
Joined
Jun 28, 2010
Messages
724
Helped
216
Reputation
442
Reaction score
219
Trophy points
1,323
Activity points
6,964
$+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
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,366
Helped
4,727
Reputation
9,469
Reaction score
4,495
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
122,588
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.
 

jpanhalt

Advanced Member level 3
Joined
Jun 28, 2010
Messages
724
Helped
216
Reputation
442
Reaction score
219
Trophy points
1,323
Activity points
6,964
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

Advanced Member level 4
Joined
May 4, 2011
Messages
115
Helped
32
Reputation
64
Reaction score
30
Trophy points
1,308
Location
Serbia
Activity points
1,980
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top