Welcome! Log In Create A New Profile

Advanced

Issue downloading program

Posted by BruceV 
Issue downloading program
July 16, 2013 02:51PM
Hi, I am having an issue when downloading my program to the BV500, via BV_COM2.
************************
function SWP()
//many lines of code
endf
//----------------------------
io_pinMode(PORTA,0,IN,WPU)
io_pinMode(PORTA,1,IN,WPU)
io_pinMode(PORTA,2,IN,WPU)
io_pinMode(PORTA,3,IN,WPU) // Maintenance SW
io_pinMode(PORTA,4,IN,WPU)
ir_setPin(?IrPORTA,“SWP”,4) // RA4
************************
When I download the program it always fails on the "ir_setPin" line of the code, but if I comment out the line then the code installs ok, I can then type the command and all is well and the interrupt calls the correct function.
-----------------------------------------------------------
ok
error line 198 >>ir_setPin(?IrPORTA, SWP ,4) // RA4<<
ERROR (3)[06]
lines loaded 19
1 Warning(s)
ERROR (3)
ok

ok
Text input Buffer 83 allocated Baud 115200

System cold start
***********************************************
* BV500 _ rookie installed Version 2.3
* Details www.bypic.co.uk/library/rookie/ *
* To clear type flclear(0) *
***********************************************
ok [06][06]
lines loaded 199
ok ir_setPin(?IrPORTA,"SWP",4)

ok print PS //PS = PowerStatus
0 // then I pressed the PowerOn button, which calls the SWP function and changes the PS value.
ok print PS
1
ok
-----------------------------------------------------------
Is there a requirement for the ir_setPin command to be issued later in the code ??
Re: Issue downloading program
July 16, 2013 03:03PM
Using interrupt is the only function that can be called before the IR function is defined because it uses the text given to it in the second term to determine the interrupt function.

Could it be that there are no quotes round SWP as shown in the error?

error line 198 >>ir_setPin(?IrPORTA, SWP ,4) // RA4<<
should be ir_setPin(?IrPORTA, "SWP" ,4)
Re: Issue downloading program
July 16, 2013 03:18PM
The code (in the program) is as typed at the top of my post and it has the ""s in, although the error message does miss them out.
I did try the 'setup commands' before the function was created, but when rec'd the error I thought it might be connected to the fact that the function name was not present yet, so moved the them to after.

Just tried this (with extra spaces)
ir_setPin(?IrPORTA, "SWP", 4)
this doesn't work (i.e. doesn't call the function) but doesn't error on download, thought it might help
Sorry, you do not have permission to post/reply in this forum.