I played with this some last night, did some reading and could not find a solution.
Maybe Darrel or Bruce will chime in...
I played with this some last night, did some reading and could not find a solution.
Maybe Darrel or Bruce will chime in...
Dave
Always wear safety glasses while programming.
DING!
PBP's system vars use a minimum of 24 bytes.
Complex formulas can increase that, but it appears you don't have any of those yet.
So you create 40 additional byte variables and it's full. (24 + 40 = 64)
As for "LST View" ...
It apparently just looks for the last occurrence of "RAM_START +" and uses that address to calculate how much RAM was used.
That address is already referenced to RAM_START, but in the program, this line subtracts the start address again, which leaves the count too low.Add 20h (32) to the 31 bytes reported and you get 63, the last address in RAM.Code:ramU = ramF - ramS
I think that line should be ...However, RAM assignments are not always contiguous. You could have a single variable in BANK3 (chip other than 675) and it'll show almost all the RAM has been used, when there's only a few bytes being used. Or the last address may be the beginning of an array, which it won't count either.Code:ramU = ramF + 1
It's a difficult task to count RAM bytes used.
<br>
DT
Thanks Darrel.
I saw where LST View was giving some "funny" results last night also. Now I know why. Time to do a "bug" fix. If possible...
Dave
Always wear safety glasses while programming.
Dave,
Just a little more info for updating LST View.
It calculates the Total RAM by taking (RAM_END - RAM_START + 1)
As an example this is from a 16F877 ...
(RAM_END - RAM_START + 1) = 1EFh - 20h + 1 = 464 bytesCode:00000020 00012 RAM_START EQU 00020h 000001EF 00013 RAM_END EQU 001EFh 00000004 00014 RAM_BANKS EQU 00004h 00000020 00015 BANK0_START EQU 00020h 0000007F 00016 BANK0_END EQU 0007Fh 000000A0 00017 BANK1_START EQU 000A0h 000000EF 00018 BANK1_END EQU 000EFh 00000110 00019 BANK2_START EQU 00110h 0000016F 00020 BANK2_END EQU 0016Fh 00000190 00021 BANK3_START EQU 00190h 000001EF 00022 BANK3_END EQU 001EFh
But the 16F877 only has 368 bytes.
The extra count is from the SFR's that are at the top of each bank.
GP RAM in each bank doesn't start at the same place on every 16F, so I think you'll need to find the amount in each bank and add them together to get the total RAM.
Then it's the same for the Used RAM. You need to subtract the SFR space from the variables address, or somehow reference it to the BANKx_START of the bank that it's in to find out how much has been used.Code:(BANK0_END - BANK0_START + 1) + (BANK1_END - BANK1_START + 1) + (BANK2_END - BANK2_START + 1) + (BANK3_END - BANK3_START + 1) ( 0007Fh - 00020h + 1) + ( 000EFh - 000A0h + 1) + ( 0016Fh - 00110h + 1) + ( 001EFh - 00190h + 1) ( 60h ) + ( 50h ) + ( 60h ) + ( 60h ) = 170h = 368
hth,
DT
Bookmarks