Broken code


Results 1 to 23 of 23

Thread: Broken code

Threaded View

  1. #13
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default Update

    Sorry for playing "20 questions". I could not post the code because the code should not be public knowledge. Anyway the problem is solved and here is an update.

    The problem is with RAM allocation, PBP has a problem when assigning RAM space to variables. In this case one byte of a WORD size variable was assigned to the last adress in BANKA and the other byte of the same Word variable to the first adress in BANK0. Variables can not span 2 banks and this is why strange things happend. Melabs helped me to find this and they are working on a fix for this. There is a workaround, assign any BYTE size variable to the last adress of each bank you are using. Check the .ASM file and you can see how many variables you are using. This problem can happen between all RAM banks not only BANKA and BANK0. For 18F4620 that I use I added

    n Var Byte $7F

    This prevents a WORD to be assigned to the last adress of BANKA and also solved the problem.

    If you have a program with many variables this is something you would like to check. This problem is ALSO in current versions of 2.47!

    Mike
    Last edited by sinoteq; - 17th February 2007 at 05:34.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 22:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. Melanies RTC code has broken
    By keithdoxey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th October 2006, 16:22

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