Go to last post By: joesaliba
Today 15:48
Forum: Absolute Beginners Section
Starter: amod
Views: 0
Replies: 21
Today 14:59
Forum: Website / Forum Issues
Starter: hadv215
Views: 0
Replies: 8
Go to last post By: charliecoultas
Today 14:23
Forum: The Lounge
Starter: charliecoultas
Views: 0
Replies: 7
Today 07:40
Forum: WIKI Discussion
Starter: AlbertoFS
Views: 0
Replies: 9
Yesterday 22:26
Forum: The Lounge
Starter: normnet
Views: 0
Replies: 0
+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Ram Variable Bytes 18F86J55218 days old

  1. #1
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    270
    Thumbs Up
    Received: 10
    Given: 0
    Total Downloaded
    269.16 MB

    0 Not allowed!

    Default Ram Variable Bytes 18F86J55

    IDE only States 1024 where data sheet states 3904, is 3904 in def file and PPI file.
    Where does the IDE get information from, states I have run out of Ram.

    David

  2. #2
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,266
    Thumbs Up
    Received: 132
    Given: 32
    Total Downloaded
    1,016.36 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    Quote Originally Posted by Dave-S View Post
    IDE only States 1024 where data sheet states 3904, is 3904 in def file and PPI file.
    Where does the IDE get information from, states I have run out of Ram.

    David
    Interestingly FL also shows 1024 as it reads from the .pbe file as follows:
    18F86J55,864,42,64
    PROGRAM COMPILED OK. 864 Bytes used from a possible 98304
    42 Variables used in the 18F86J55 from a possible 1024
    Norm
    Last edited by normnet; 15th November 2017 at 23:50.

  3. #3
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    270
    Thumbs Up
    Received: 10
    Given: 0
    Total Downloaded
    269.16 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    Interestingly FL also shows 1024 as it reads from the .pbe file as follows:

    18F86J55,864,42,64
    PROGRAM COMPILED OK. 864 Bytes used from a possible 98304
    42 Variables used in the 18F86J55 from a possible 1024
    Yes it complies ok if under 1024 but I get :-

    "ERROR
    Not enough RAM for all the variables. Reduce the amount, or switch to a larger device."

    If over 1024.

    I thought it took the values from the def/ppi files which are 3904

    How do I change it?

    David

  4. #4
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    270
    Thumbs Up
    Received: 10
    Given: 0
    Total Downloaded
    269.16 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    It would appear this is because the Ram is being used by the USB see,
    http://www.protonbasic.co.uk/showthr...ual-access-RAM

    If you turn off USB then you get the full 3904, I cannot do this as I am using the USB.
    I am surprised the USB is using 2880 and it is dual ram.

    Will have to try and reduce my variables.

    David

  5. #5
    Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    337
    Thumbs Up
    Received: 54
    Given: 0
    Total Downloaded
    95.95 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    I am surprised the USB is using 2880
    I doubt that it is. The problem is that the USB dual port ram is right smack dab in the middle of the ram memory map at 1024.
    That splits the ram available to the compiler into two blocks... one below the USB ram and one above it.

    The compiler would have to know about this and be able to use two different blocks. Don't know if it can do that or not.

  6. #6
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    270
    Thumbs Up
    Received: 10
    Given: 0
    Total Downloaded
    269.16 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    Quote Originally Posted by tumbleweed View Post
    I doubt that it is. The problem is that the USB dual port ram is right smack dab in the middle of the ram memory map at 1024.
    That splits the ram available to the compiler into two blocks... one below the USB ram and one above it.

    The compiler would have to know about this and be able to use two different blocks. Don't know if it can do that or not.
    The USB def file states -USB_RAM = 1024 and gives the Start as 400, can you just alter that start Position?

    In the USB_memalloc.inc it states " Global buffers - these are mapped onto USB RAM space (when possible), thus saving program RAM."

    If that's the case, how do you use the saved program ram?

    David
    Last edited by Dave-S; 16th November 2017 at 16:10.

  7. #7
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,380
    Thumbs Up
    Received: 306
    Given: 117
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    That's one of the stupid things that Microchip did way back when, and never changed it. They made the USB RAM in a fixed position. On the older devices, this was OK because it was actually at the end of RAM, however, the later devices went beyond this RAM, but obviously, they are using someone else's USB tranceiver module in the devices and they never got round to changing it for later devices

    There is not easy transition to using the RAM above the USB automatically, and because of the limited amount of USB devices, the time and code changes in the compiler simply did not warrant delving into the RAM routines, and maybe breaking it.

    You could use the "AT" modifier when creating variables, and make them at addresses above what is being used for the USB.

    If you want to remove the RAM created by the compiler for USB devices, use the declare "Declare Onboard_USB = 0"
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  8. #8
    Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    337
    Thumbs Up
    Received: 54
    Given: 0
    Total Downloaded
    95.95 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    can you just alter that start Position?
    As Les said, the position is fixed and can't be changed.

    On some devices you can shrink the fixed portion down and use other memory for the usb endpoint data buffers,
    but the usb BDT has to stay at that fixed address so it doesn't help much.

  9. #9
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    270
    Thumbs Up
    Received: 10
    Given: 0
    Total Downloaded
    269.16 MB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    Quote Originally Posted by Les View Post
    That's one of the stupid things that Microchip did way back when, and never changed it. They made the USB RAM in a fixed position. On the older devices, this was OK because it was actually at the end of RAM, however, the later devices went beyond this RAM, but obviously, they are using someone else's USB tranceiver module in the devices and they never got round to changing it for later devices

    There is not easy transition to using the RAM above the USB automatically, and because of the limited amount of USB devices, the time and code changes in the compiler simply did not warrant delving into the RAM routines, and maybe breaking it.

    You could use the "AT" modifier when creating variables, and make them at addresses above what is being used for the USB.

    If you want to remove the RAM created by the compiler for USB devices, use the declare "Declare Onboard_USB = 0"
    Thanks very much Les for that information, have managed at the moment to reduce the variables being used.

    David

  10. #10
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,617
    Thumbs Up
    Received: 102
    Given: 146
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: Ram Variable Bytes 18F86J55

    As an alternate to Les's (use AT) maybe easier to use HEAP and let the compiler work out the address of each variable for you.
    George

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. 18F86J55 Oscillator configurations
    By Dave-S in forum Proton Plus Compiler v3
    Replies: 9
    Last Post: 20th October 2017, 21:26
  2. USB Dual Ram Memory error 18F86J55
    By Dave-S in forum USB Module
    Replies: 0
    Last Post: 14th October 2017, 16:37
  3. Reserve some variable for interrupt at top of ram...
    By SELCUK in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 5th November 2013, 00:27
  4. "Variable bytes used" > max RAM
    By Latex in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 22nd September 2005, 16:50

Members who have read this thread since 10th June 2018, 06:15 : 0

Actions :  (Set Date)  (Clear Date)

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

Tags for this Thread

Posting Permissions

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