Surprisingly Useful PIC18F Discovery

Thread Starter

ErnieM

Joined Apr 24, 2011
8,377
Having used the 18F series Microchips only for several years, I know I don't know a tenth of what they can do...

I just learned something I'd never noticed before: The CALL and RETURN instructions have an extra argument 's'.

According to the datasheet, if the 's' argument is 1, then WREG, STATUS, and BSR are pushed onto the "fast return stack" for a CALL and popped off the stack for a RETURN.

Neat, I thought...I could find some use for this.

Now you need be careful when playing around as these use the "fast return stack" and that is the same fast return stack that is used for interrupts, regardless if RETFIE FAST instruction is used or not.

So, basically, if you are not using interrupt at all you can grab the benefit of a super fast call and return for that one precious routine you need damn fast. Or multiple routines if you are damn careful not to call one from another.

Leave it Microchip to leave no trick unused and make available some hardware where you just may need it.

It's all well documented in the data sheet between the "INSTRUCTION SET SUMMARY" section 24.0 and section 9.9 "Context Saving During Interrupts."

Just thought I'd bring this up for those who might be interested.
 

Eric007

Joined Aug 5, 2011
1,158
I created a thread asking about 'who write the datasheet and design' those PICs but I had no replies...

So i'm going to ask it again! Is it a 'special' team of engineers within Microchip that sit and design/and write or ...anyway how does it work over there? anybody knows?
 

nsaspook

Joined Aug 27, 2009
13,315
I created a thread asking about 'who write the datasheet and design' those PICs but I had no replies...

So i'm going to ask it again! Is it a 'special' team of engineers within Microchip that sit and design/and write or ...anyway how does it work over there? anybody knows?
The people that know can't tell but if you need to order a few million of a custom part I'm sure someone will call you back to design it for you. :p
 

Thread Starter

ErnieM

Joined Apr 24, 2011
8,377
Perhaps this question would best be asked on the Microchip forum.

They have actual MC employees looking at those.
 

nsaspook

Joined Aug 27, 2009
13,315
Why they can't? Is it a secret? I'm just curious...
It was 98 percent a joke but typically the TD group and anyone who has access to future device plans is under an NDA about internal device processes and procedures. It doesn't mean it's secret, it's just that YOU are not authorized to talk about it. "ErnieM" is correct.
 
Last edited:

Eric007

Joined Aug 5, 2011
1,158
It was 98 percent a joke but typically the TD group and anyone one who has access to future device plans is under an NDA about internal device processes and procedures. It doesn't mean it's secret, it's just that YOU are not authorized to talk about it. "ErnieM" is correct.
A joke...:) well it sounded like one but...
I think you know and can share the info since you are *part of the Microchip team* ... Humm so tell us... :D
 
Top