Program Stops Executing After Closing Javelin IDE
I am using a Javelin Stamp in an embedded application with a PC. The PC is an EPIC form factor SBC and the computer and the Javelin are permanently connected together with the JIDE port. The Javelin Stamp is on the Demo Board.
I wrote/tested/debugged a communication protocol to extract sensor data from the Javelin using the Message window and everything worked great until I closed the IDE and tried to use my custom C# application to implement the protocol. First, as soon as the IDE is closed the program on the stamp stops executing. I figured that was just because hardware control line(s) must be asserted in order for the program to run while connected to the PC, so I tried every combination of asserting, deasserting, and reasserting DTR and RTS. The only thing that causes the program on the Javelin to execute (momentarily) is sending data to it. If I send data to it it will echo the data back and the program will execute for a few milliseconds (but not long enough to return sensor data). This behavior resembles the Message window in the IDE so at least it is receiving and transmitting data momentarily.
My question is: what must be done (and is being done by the Javelin IDE after it loads a program onto the stamp) for the Javelin to run continuously after the JIDE is closed?
I have tried using Hyper Terminal to talk to the Javelin through the JIDE as well and have set it up exactly per the documentation:
Bits/Sec: 9600
Data Bits: 8
Parity: None
Stop Bits: 1
Flow Control: Hardware
and have had even less luck (program on Javelin does not run, no communication, not even echo). But according to the documentation, Hyper Terminal should be able to interface to the Stamp.
All the basics are covered, I am sure I am using the correct COM port in all instances of testing, the COM port is set up correctly, and the program works exactly as expected when it is run post Programing from the Javelin IDE, the Message window allows me to poll all the sensors and assume manual control over my outputs. There is just something I am missing with regard to interfacing the Javelin to my custom application. I am not disconnecting/reconnecting anything between testing with different applications. One further note: the Javelin program resumes execution as soon as the computer is shut down. I cannot use separate COM ports to program and communicate because the other COM ports on the PC are assigned to other peripherals. And furthermore I would like the JIDE port to be connected at all times for code recompilation if necessary.
Thanks for any insight you can give me,
Weston
I wrote/tested/debugged a communication protocol to extract sensor data from the Javelin using the Message window and everything worked great until I closed the IDE and tried to use my custom C# application to implement the protocol. First, as soon as the IDE is closed the program on the stamp stops executing. I figured that was just because hardware control line(s) must be asserted in order for the program to run while connected to the PC, so I tried every combination of asserting, deasserting, and reasserting DTR and RTS. The only thing that causes the program on the Javelin to execute (momentarily) is sending data to it. If I send data to it it will echo the data back and the program will execute for a few milliseconds (but not long enough to return sensor data). This behavior resembles the Message window in the IDE so at least it is receiving and transmitting data momentarily.
My question is: what must be done (and is being done by the Javelin IDE after it loads a program onto the stamp) for the Javelin to run continuously after the JIDE is closed?
I have tried using Hyper Terminal to talk to the Javelin through the JIDE as well and have set it up exactly per the documentation:
Bits/Sec: 9600
Data Bits: 8
Parity: None
Stop Bits: 1
Flow Control: Hardware
and have had even less luck (program on Javelin does not run, no communication, not even echo). But according to the documentation, Hyper Terminal should be able to interface to the Stamp.
All the basics are covered, I am sure I am using the correct COM port in all instances of testing, the COM port is set up correctly, and the program works exactly as expected when it is run post Programing from the Javelin IDE, the Message window allows me to poll all the sensors and assume manual control over my outputs. There is just something I am missing with regard to interfacing the Javelin to my custom application. I am not disconnecting/reconnecting anything between testing with different applications. One further note: the Javelin program resumes execution as soon as the computer is shut down. I cannot use separate COM ports to program and communicate because the other COM ports on the PC are assigned to other peripherals. And furthermore I would like the JIDE port to be connected at all times for code recompilation if necessary.
Thanks for any insight you can give me,
Weston
Comments
The JIDE port uses 28800 baud, not 9600.
Secondly, there is no hardware flowcontrol. The DTR line·is used
to reset the javelin. So you need to turn off the DTR in your
PC application otherwise the Javelin will not run.
Thirdly, your pc application may appear being stopped after closing
the IDE because your javelin program is using Terminal.getChar() (is it ??).
Your pc application·must never initiate communication.
It must wait for messages (send by javelin using System.out.print)
or datarequests (0x11), sent when you use Terminal.getChar(), after which your pc application must
respond with either 0x12 <b> if data is waiting, or 0x13 if you have no data.
regards peter
if(Terminal.byteAvailable())
terminalIn = Terminal.getChar();
Does Terminal.byteAvailable() send the data-request and return true or false based on the dataWaiting/noData reply? That seems more reasonable.
The information you provided helped me solve the problem, thank you.
Weston
function getByte() that sends the datarequest to the IDE.
Just look at Terminal.java in folder core to see how it works exactly.
regards peter