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.

[SOLVED] Need Assistance on "Org" use in pic Programming

Status
Not open for further replies.

4848

Newbie level 3
Joined
Jun 2, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
I Understood two "Org" address which are "org 0x00 and "org 0x04". I try to write a program using MPASM and during simulation Th program counter will branch back to address '0x00' when it reach Address 0xFF instead of going to next code after the address 0xFF. I solve the problem by inserting Org 101 at the location where the PC do branch to unintended address. Although the program is running ok but I did it by Trial and Error, I did not Know the reason why It should be there before the program will work well. please help me out.
 

Hi,

The ORG Directive is used to tell the chip where to put the following code in program memory, it IS used in Absolute mode as well.

If your code appears to branch to 0x00 at 0xFF then post your code so we can see whats happening as thats not right.


Edit - have you got the Watchdog disabled ? WDT=OFF in your Config line, that will Reset your program if its ON by default.
 
Last edited:

I concur, Jayanth crossed them over, absolute code needs an ORG, relocatable will let the linker choose it.

Something is wrong though if the program counter wraps around at 0xFF. Only the 10F200 and 10F204 might possibly do that because they only have 256 bytes of program space. When you used ORG 101 it may have seen that as a decimal number and actually used hex address 0x65. Post your code so we can check.

Brian.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top