PDA

View Full Version : srange warning



keymuu
- 10th November 2015, 08:50
Hi all!

Can anyone explain why and how such a warning is possible:

Warning[219] C:\pbp\pbppi14e.lib 937 : Invalid RAM location specified. :disturbed:

I have commented out a lot but can't figure out what causes that

Thank you in advance

keymuu

HenrikOlsson
- 10th November 2015, 10:32
Which version of PBP?
Which device are you targeting?
Which version of MPASM?
Can you post the code?

/Henrik.

keymuu
- 11th November 2015, 06:33
Hi Henrik,

my PBP is 2,60C and the code is:


TMPaddr CON %1001110 ' the address to TMP100
LCDaddr con $20 ' the address to LCD
cont con $A0 ' for I2C READ and WRITE, NOT for any other use
TRUE con 1 ' or HIGH
FAlSE con 0 ' or LO
'LCD
firstL con $80 ' LCD first (1) line (page 107 PICBASIC PRO book)
secondL con $C0 ' LCD second (2) line
thirdL con $94 ' LCD third (3) line
fouthL con $D4 ' LCD fourth (4) line
home con $02 ' LCD return home
clearD con $01 ' LCD clear display
offC con $0C ' LCD cursor off
'PORTA.x
dataPort var PORTA.0 ' I2C data port
clkPort var PORTA.1 ' I2C clock port
RELE var PORTA.2 ' OUT- RELE, or TIP120 (darlington) that drives the rele
LEDs VAR PORTA.3 ' OUT- Lo (GREEN) Hi (RED)
goDOWN var PORTA.4 ' IN- or SET DOWN one step (target)
goUP var PORTA.5 ' IN- SET the temperature UP (target)
'TEMP and TIME
changeTEMP var byte ' how much TEMPERATURE (TARGET)
changeTIME var byte ' how much TIME (TARGET)
changeTEorTI var bit ' is there a need to change TIME or TEMPERATURE (TARGET)
nowTEMPERATURE var byte' update TEMPERATURE only NOT TIME
nowTIME var byte ' ready to change TIME not TEMPERATURE
tempREAD var byte ' the real water temperature
tempSET Var byte ' the temperature goal or set temperature
'FALSE is the active state for the nexts command flags:
markUP var bit ' temporary mark remembers wich one is active
markDOWN var bit ' temporary mark
b var byte ' general index
temp var byte ' temperary variable
'Next LCD stuff, here under, 4 lines
tempData var word ' Temperature data
timeData var word ' Time data
hour var byte
minut var byte
second Var byte ' Define display hour variable
minute Var byte ' Define minute variable
ticks Var byte ' Define pieces of seconds variable
update Var byte ' Define variable to indicate update of LCD

'12345678901234567890' LCD has 20 places for characters
INTCON = $a0 ' Enable TMR0 interrupts
'-------------------------------------------------------------------------------
writeLCD ' general write to LCD
i2cwrite dataPort, clkPort, cont, $FE, secondL, tempdata' the real temperature
i2cwrite dataPort, clkPort, cont, $FE, thirdl, timedata' write the real time
return ' writeLCD
'-------------------------------------------------------------------------------
writeFirstLineLCD ' when the user has changed from TEMP to TIME or vs
if nowTIME = true then ' first line tells wich will change TEMP or TIME
i2cwrite dataPort, clkPort, cont, $FE, firstl, " Time "
else' nowTEMPERATURE
i2cwrite dataPort, clkPort, cont, $FE, firstl, " Temperature "
endif
return ' writeFirstLineLCD
'-------------------------------------------------------------------------------
'======================end=LCD==================== ==============================

Debounce
For b = 1 To 100 ' Debounce and delay for 100ms
Pause 1 ' 1ms at a time so no interrupts are lost
Next b
return
'-------------------------------------------------------------------------------
SET ' set a TARGET for TIME or TEMPERATURE
if nowTIME = true then ' is the time or perhps not?
if goUP = true then '
changetime = changetime + 1 ' increase the time with one
markup = true : markdown = false '
else '
changetime = changetime - 1 ' decrease the time with one
markDOWN = true : markup = false '
endif '
nowTIME = true : nowTEMPERATURE = false ' use TIME
else ' nowTEMPERATURE ' if not TIME then TEMPERATURE
if goUP = true then '
changeTEMP = changeTEMP + 1 ' increase the temp with one
markup = true : markdown = false '
else '
changeTEMP = changeTEMP - 1 ' decrease the temp with one
markdown = true : markup = false '
endif '
nowTEMPERATURE = true : nowTIME = false ' use TEMPERATURE
endif
return 'SET
'-------------------------------------------------------------------------------

' this is like an interrupt routine, however, it is not an interrupt routine,
' so it is just a normal sub routine
longPress ' if up/down is pressed for about 5 sec change from TEMP to TIME or vs

' First we have to decice is UP or DOWN pressed
if (goUP = true) and (goDOWN = true) then return ' NOT pressed anything
' not UP or DOWN
if goUP = false then ' IF upwards is active
gosub Debounce
for b = 1 to 5 ' every round takes 1 second
if goUP = true then return ' end if not pressed anymore
pause 1000 ' wait for 1000 ms and the total will be 5 seconds
markup = true : markdown = false ' also mark it UP
next b
else ' IF downward is active
gosub Debounce
if goDOWN = true then return ' it is not time to change the TIME or TEMP
for b = 1 to 5 ' the total will be 5 seconds
if goDOWN = true then return ' end if not pressed anymore
pause 1000 ' wait for 1000 ms
markdown = true : markup = false ' also mark it DOWN
next b
endif
' FALSE is active state, i.e. button pressed UP
if (markup = true) and (b = 5) then
changetime = changetime - 1 ' compensate the UP press
endif ' FALSE is active state, i.e. button pressed DOWN
if (markdown = true) and (b = 5) then
changetime = changetime + 1 ' compensata the DOWN press (possible long)
endif
' if b=5 then we will change from TEMP to TIME or TIME to TEMP
' time has elapsed for 5 seconds
if b = 5 then toggle changeteorti 'do the change from TEMP to TIME or vs
gosub SET ' change (TIME to TEMP) or (TEMP to TIME)
gosub writeFirstLineLCD
return ' longPress ' L378A
'======================end=longPress============== ==============================

checkIFpressed ' check if pressed and also mark if it is UP or DOWN
' and act to that
if goup = true then ' first check UP
markup = true : high rele : high leds ' and act to that
else ' else it is false
markup = false : low rele : low leds ' and act to that
endif

return ' chekIFpressed now we know if it is UP or DOWN also
'-------------------------------------------------------------------------------

readTEMP ' Read the REAL water temp to readTEMP
i2cread dataPort, clkPort, cont, TMPaddr, tempRead

if tempRead < tempSet then ' Check where the real temperature is
changeTeorti = true ' set the heat ON
else
changeTeorti = FALSE ' or OFF. But not here, IT HAPPENS LATER
endif

return 'readTEMP ' now we know, shall we HEAT or NOT HEAT
'-------------------------------------------------------------------------------

input PORTA.5 : input PORTA.4 ' UP and DOWN, the only button
output PORTA.3 : output PORTA.2 ' 3=LEDs (green and red), 2=TIP120-> RELE
changetime = 60 : changetemp = 60 ' initial values for TIME and TEMP (60 & 60)
Pause 500 ' Wait for LCD to startup
hour = 0 ' Set initial time to 00:00:00
minute = 0
second = 0

mLoop: ' the main Loop writeLCD
markup = false : markdown = false ' mark them FALSE for next round writeToLCD
changeTEMP = false ' Let's assume it is not pressed Debounce
changetime = false ' and this also SET
' longPress
gosub readTEMP ' read the temp and check if the SET temperature has changed checkIFpressed
gosub checkIFpressed ' the changeTEorTI will perhaps have a value readTEMP
' next we do a fake interrupt call
gosub longPress ' check if there is a need to change from TEMP to TIME of vs

' i2cwrite dataPort, clkPort, cont, lcdaddr, temp ' write the LCD

goto mloop ' keep on looping
end


the processor is PIC12LF1552 but I don't have it yet, and the program is far from ready
and it is not so nice to have a warning like floating around, it could be a symptom of something
more problematic.

keymuu

HenrikOlsson
- 11th November 2015, 07:13
Hi,

Your code compiles fine for a 12LF1552 using PBP 3.0.8.4 and MPASM 5.45.

I don't have 2.6C available to try with but it seems as if the warning is thrown by the assembler and not by the compiler. Googling a bit further suggests that the problem might be due to a corrupt or incompatiable .inc file for the device (that would be the .inc file in the MPASM folder, not in the PBP folder).

You didn't say which version of MPASM you're using but I'd try updating or re-installing MPLAB. I'm attaching the p12LF1552.inc file from my MPASM installation (renamed to .txt to able to upload it). You could try replacing yours with this one and see if it helps.

/Henrik.

Charlie
- 11th November 2015, 14:45
Are you sure you chose the correct device to compile for? I saw this once when I accidentally changed devices and the new choice had less ram.

keymuu
- 12th November 2015, 07:56
Hi !

I don't know where I can see the version of MPASM.
I use under (at the moment) 600 words when there is 2k in PIC12LF1552.
And I will upgrade to PIC 3.0 very soon and I suspect that it can be a
question of something that is amended in the latest version.

keymuu

HenrikOlsson
- 12th November 2015, 09:46
Hi,


I don't know where I can see the version of MPASM.
You can see which version of MPASM you're using in the progress window during the assembly process:
8090

If, for some reason you don't see that you can always start the MPASM GUI application (MPASMWIN.exe) in the MPASM installation folder and see it there:
8091


I use under (at the moment) 600 words when there is 2k in PIC12LF1552.
Yes but are you sure that you're actually compiling for the 12LF1552 and not for another device, by mistake. Are you using MicroCodeStudio, do you have the 12LF1552 selected in the dropdown list?

Before you upgrade to PBP3 (which I highly recommend anyway) you can try replacing the MPASM .inc file with the one in my previous post. Make sure you save the old one.

/Henrik.

keymuu
- 12th November 2015, 20:43
Hello,

the version of MPASM is 5.39

kind regards

keymuu

HenrikOlsson
- 13th November 2015, 06:07
Then I'd try an update of MPLAB.
Go here (http://www.microchip.com/pagehandler/en-us/devtools/dev-tools-parts.html) and download a new version. I'm currently on v8.85 but I'd grab the last v8 there is (v8.92).

/Henrik.

keymuu
- 3rd December 2015, 20:21
Hi!

I have now PBP 3.08 and MPLAB is something like 8.95, but I have a problem,
my PBP3 is a "Trial Edition" and I don't understand why.

When I installed PBP3 I did NOT check the empty checkbox between PBP3 and
MPLAB not so far from the beginning of the installation.

Maybe this is not the correct place for this question, if not then where should
i address my question, to who or to what instans.

keymuu

HenrikOlsson
- 3rd December 2015, 20:33
Hi,

Did you buy the upgrade from MeLabs or did you just download PBP3 from their website?

If you bought the upgrade you should've received your personal activation code. Run the PBP Activation Manager to activate your license.
If you did not buy the upgrade well, then that's the reason for it being trial.

/Henrik.