D
David Merrill
Hey folks -
Does anyone have intimate experience doing serial input in Java
(win32)? I've got the following situation (using the current version
of the java comm api):
- microcontroller sending 52 bytes of data via serial to the PC, at a
baud rate of 115200bits/sec - sending a 52-byte "packet" about 180
times/sec.
- java program writing each received byte out to a file (and not
doing *anything* else with the data but writing it out..)
What happens is : the first ~100 packets (52 bytes each) come through
all right, then all hell breaks loose. I get fragments of packets,
chunks of 4 bytes plucked from packets, etc.. It seems to follow a
pattern at this point, although not all of my data is getting through
- looks like bytes are being dropped *before* they get to my
file-writing code in the Java environment.
What I've determined: I looked at the (live) data in HyperTerminal,
and it's beautiful. No bytes are dropped. So it's not something to do
with the serial -> usb adapter that I'm using on my computer. So I
think it's something to do with Java's handling of serial data - i.e.
maybe there is some internal buffering that's getting full, and
starting to misbehave... Has anyone come across this problem before,
or have any suggestions of what I can try?
much appreciated,
David M.
Does anyone have intimate experience doing serial input in Java
(win32)? I've got the following situation (using the current version
of the java comm api):
- microcontroller sending 52 bytes of data via serial to the PC, at a
baud rate of 115200bits/sec - sending a 52-byte "packet" about 180
times/sec.
- java program writing each received byte out to a file (and not
doing *anything* else with the data but writing it out..)
What happens is : the first ~100 packets (52 bytes each) come through
all right, then all hell breaks loose. I get fragments of packets,
chunks of 4 bytes plucked from packets, etc.. It seems to follow a
pattern at this point, although not all of my data is getting through
- looks like bytes are being dropped *before* they get to my
file-writing code in the Java environment.
What I've determined: I looked at the (live) data in HyperTerminal,
and it's beautiful. No bytes are dropped. So it's not something to do
with the serial -> usb adapter that I'm using on my computer. So I
think it's something to do with Java's handling of serial data - i.e.
maybe there is some internal buffering that's getting full, and
starting to misbehave... Has anyone come across this problem before,
or have any suggestions of what I can try?
much appreciated,
David M.