Serial communication PC <--> Javelin
I'm trying to communicate with the Javelin using a RS232 DLL.
When I try, I see no flashing light on my RS232 to USB adapter when I turn the Javelin on,
When I open the Javelin IDE, then turn the Javelin on, it starts flashing.
Is there any signal I've got to send to the Javelin to let it know the computer is connected?
I've used the following values:
Baud rate: 9600
Byte size: 8
Parity: 0
Stop bits: 1
Read timeout: 0
Write timeout: 0
Thanks,
Robot Freak
When I try, I see no flashing light on my RS232 to USB adapter when I turn the Javelin on,
When I open the Javelin IDE, then turn the Javelin on, it starts flashing.
Is there any signal I've got to send to the Javelin to let it know the computer is connected?
I've used the following values:
Baud rate: 9600
Byte size: 8
Parity: 0
Stop bits: 1
Read timeout: 0
Write timeout: 0
Thanks,
Robot Freak
Comments
From your baud parameters, it looks you try
to communicate via javelin I/O pins and a levelshifter,
like using the COM connecter on the javelin demoboard.
If you use the programming port (JIDE of the javelin
demoboard), that only supports 28800 baud and
requires a special protocol.
regards peter
What special protocol does the Javelin require in order to get Terminal.getChar and System.out.print working?
Kind regards,
Robot Freak
What is the protocol used to send messages to and from the Sin and Sout pins?
Debug messages sent from the Javelin conform to the following pattern:
0x05 0x03 <messagedata> 0x7E
<messagedata> is the sequence of bytes being sent by the CPU.message() native method. It is byte-stuffed. This means that if <messagedata> contains a byte <b> that has the value 0x7F or 0x7E then that byte is replaced with 0x7F <b>^0x20. i.e. 0x7F followed by the orginal byte xored with 0x20.
Terminal characters are sent to the Javelin using the following algorithm:
After the Javelin is reset it send 0x0F followed a pause followed by 0x50 (the version of the Javelin firmware).
Running the following simple program:
public class HelloWorld { public static void main() { System.out.println("Hello World"); } }
will generate the following on Sout:
0F 50 05 03 48 65 6C 6C 6F 20 57 6F 72 6C 64 7E 05 03 0D 0A 7E 05 05 7E
Note that the sequence 0x05 0x05 0x7E indicates that the Java program has ended.
What is important, is that your pc program must wait for 0x11 (javelin ready to receive a byte),
and that ANY byte sent to the javelin is echoed.
Attached is an example program (in javelin java) that demonstrates how you can implement
this protocol on the pc. It uses a statemachine. Also attached is a test program that you
download to the javelin. It assembles a textcommand and then prints the command
to the messagewindow. It is only tested with Javelin IDE version 2.0.3
regards peter
I know it's an old thread, but I'm trying to connect the Javelin Terminal to a Linux server in order to store the output and I'm having some troubles.
I can configure the com port to be 9600, 19200, 38400, etc. But not 28800. So I'm seeing some information coming, but I'm not able to parse them. Is there a way to modify the terminal in order to have it at 19200 or 38400? Or should I configure the server at 38400 and use a specific protocol in order to be able to transform the flow?
Thanks,
JM
The javelin firmware uses 28800 (they really should have selected 19200
which is much more common) and cannot be altered.
Take a look at Javelintools (for linux):
http://sourceforge.net/project/platformdownload.php?group_id=189174
regards peter
Thanks for your prompt reply. I'm also trying to see with HyperTerminal (Windows) and I have the same issue. It's not able to set 28 800. Is it possible to link HyperTerminal with the Javelin? How? I tryed 19200 8N1 and 38400 8N1 with no success. Maybe 8N1 is not right?
Thanks for you help.
JM
that lets you save message window output to a file.
http://tech.groups.yahoo.com/group/JavelinCode/files/JideTerm/
You can also use the IDE beta, that also lets you save message window
output to a file.
regards peter
After a lot of tries, I'm finally able to make it works under Linux.
Just in case someone else is looking for it:
Where /dev/ttyS0 is your serial port.
And on the Java side, you need the javax.comm API.
This is just a re-use of the simple sample provided with the Sun API.
Now I still have to parse the data based on the protocol (headers, Javelin Ready, etc.) but it's on the good way [noparse];)[/noparse]
Thanks,
JM