433MHz RF PIC2PIC connection


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph,

    Using GOSUB to call a sub-routine that returns to the calling routine with a GOTO VS a RETURN eats up your stack since there is no RETURN instruction to POP the return address back from the stack. You end up with stack over-flow.

    On the 16F series you have an 8 level deep stack, and once it's filled up, it starts being over-written (circular type buffer) by further return addresses pushed onto the stack from top-to-bottom.

    While your program may or may not work on a 16F part when doing this, it can still cause trouble depending on how many consecutive calls you have before returns start (referred to as nesting) popping addresses back off the stack.

    You have return addresses being pushed onto the stack by PBP library functions + your own code. With the 16F's circular type stack buffer, you're getting by with the boo-boo because return addresses are still being pushed on the stack (simply overwritting previous contents), and all's well if you're not nesting calls too deep.

    One the 18F parts you have a 31 level stack, BUT, it's not the circular type buffer like you have with the 16F. Once you get to location 31 the 32nd return address simply overwrites location 31,
    and it's sit & spin at location 31 from there on.

    I.E. you're now stuck at the last stack level, and nothing else can be pushed onto the stack leaving you with only "1" stack position where a return address is stashed to any caller.

    Your program gets shot-off into la-la land somewhere, and goes haywire. Basically, it goes like splat...;o]

    >>forces a lock-up of the 18F252 after 29 successful loops<<

    That's why the above happens. You're OK until you hit that magic number on the 18F.

    TIP:
    You can use the STVREN config bit on the 18F series to help you find bugs like this, and force a device reset on stack overflow/underflow conditions.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161


    Did you find this post helpful? Yes | No

    Default Code Help

    Hello Ralph,

    Can You Please Share Ur Code For The 16f Series Mcu. I Am Facing Some Problem In Rx Data Over Rf Using 2400.

    Would Be Grateful If You Could Include Your Manchester Coding Bit As Well.

    Thanks

Similar Threads

  1. Generic RF Receiver
    By dhouston in forum Code Examples
    Replies: 0
    Last Post: - 8th September 2009, 14:35
  2. Interfacing 16F88 to RF module
    By scomi85 in forum General
    Replies: 2
    Last Post: - 19th February 2009, 12:52
  3. CO2 MG811 sensor connection
    By elektoro2009 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th May 2008, 00:49
  4. Replies: 2
    Last Post: - 29th September 2007, 06:49
  5. Need CRC for RF PIC2PIC Bit arrayed interface
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 24th August 2006, 12:35

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts