Eng.Abbasi said:
... ... when i turn off the pic and if i measure the output of the pic there is nothing .
You placed a scoop on the TXD, RXD lines between PIC and PC and saw nothing at all while your PC still gets data. Is that what you did or did you use a multimeter ?
If you really see a stable 0V signal we can forget the noise thing suggested by Philba.
Eng.Abbasi said:
...so of any one tried before interfacing with serial port by java , i appreciate if he told me thanks all
Never did, always used VB or LabView with 8031 µP, never had problems like yours.
A few new questions. Hopefully you will answer this ones...
1) The data you receive after power down the PIC, is it correct data?
I mean if you generate a square wave, I suppose you get data from which you can rebuild a square wave in your java application, what about the data received while the PIC is powered down? Can you still make a square wave out of it?
If yes, I think that's data stored in a buffer somewhere on the PC side, so nothing to worry about (unless you buffer overflows in time, but that's for later... ...).
If no, Philba's noise thing is back on track or ... ...
2) Can you use Hyperterminal to see if you have the same issues?