Go to last post By: charliecoultas
Today 16:21
Forum: Website / Forum Issues
Starter: Lester
Views: 0
Replies: 6
Today 02:26
Forum: New devices and techniques
Starter: normnet
Views: 861
Replies: 1
Yesterday 22:04
Forum: USB
Starter: See_Mos
Views: 0
Replies: 3
+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Ram Variable Bytes 18F86J5527 days old

  1. #1
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    260
    Thumbs Up
    Received: 5
    Given: 0
    Total Downloaded
    268.81 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,197
    Thumbs Up
    Received: 92
    Given: 29
    Total Downloaded
    766.61 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; 16th November 2017 at 00:50.

  3. #3
    Member Dave-S's Avatar
    Join Date
    Sep 2004
    Posts
    260
    Thumbs Up
    Received: 5
    Given: 0
    Total Downloaded
    268.81 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
    260
    Thumbs Up
    Received: 5
    Given: 0
    Total Downloaded
    268.81 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
    265
    Thumbs Up
    Received: 32
    Given: 0
    Total Downloaded
    76.31 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
    260
    Thumbs Up
    Received: 5
    Given: 0
    Total Downloaded
    268.81 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 17:10.

  7. #7
    Developer Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,245
    Thumbs Up
    Received: 230
    Given: 87
    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
    265
    Thumbs Up
    Received: 32
    Given: 0
    Total Downloaded
    76.31 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
    260
    Thumbs Up
    Received: 5
    Given: 0
    Total Downloaded
    268.81 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,359
    Thumbs Up
    Received: 49
    Given: 124
    Total Downloaded
    2.37 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, 01: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 9th December 2017, 07:13 : 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