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

PIC Software stack access.

Status
Not open for further replies.

Pheetuz

Full Member level 3
Joined
Feb 12, 2010
Messages
163
Helped
21
Reputation
42
Reaction score
19
Trophy points
1,298
Location
Brighton
Activity points
2,835
I am looking to create a stripped out operating system kind of thing for a PIC, this is mostly just to further my knowledge of micro-controllers, the plan is for there to be three tasks running at once, each one appearing transparent to the other tasks.

As I understand it there are two types of stacks in a PIC18, the hardware stack and the software stack, the hardware stack is used for storing program counter return addresses from functions and the software stack is used for storing non-static variables used by functions.

I have written some assembly code using the FSRs to transfer the hardware stack into memory which works fine, I have also copied the working / status registers to memory along with a load of other registers that will be unique to the task, such as the math.h variables.

Basically, I figured it would be faster for me to just change the pointer to the start of the software stack and the software stack frame pointer rather than to copy all of the data out of the software stack into temporary memory and then load the other tasks software stack out of temporary memory.

I understand the concept of how to do this but I cannot find anything in the datasheet that even hints as to the name of the software stack pointers or any registers that can be used to change their values.

Any help is greatly appreciated!

Thanks,

Pheetuz
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top