Hi
I have plugged a GPS unit to a PIC 18F4550 and was hoping (for now) to get the raw GPS data into the PIC and them send it out on a USB serial connection.
This is research into what other things / data strings I can manipulate from the GPS unit, Hence the reason for not using the GPS component.
I put together a simple Flowcode prog to read the data as a string from the GPS over the RS232 RxD pin RC7
I then send that same string out of the USB serial connection to terminal without any alteration.
Everything seems to work excep that I am getting odd characters being added to the string sent to terminal via the USB serial connection.
As I say Added because all the other data is there but there are odd characters in the string at odd places.
I have the same RS232 data going directly into one of the PCs RS232 ports too and so can compare them both at run time. The one going directly to the RS232 port is OK, no additions.
If I send this through a PL-2303 chip to a USB port there is no corruption so my guess there is something I am doing wrong with the string declaration or the parameters required in the components property settings.
I have declared the string variable as GPS_Read[100]
Parameters for the RS232 reading into the string
nTimeout(BYTE) , NumBytes(BYTE) = 10, 100
Return Valuse = GPS_Read[100]
I have attached a screen dump and logs from the 2 terminal screens (both terminal windows were setup the same (except for the port number))
Many Thanks
USB Serial Write Problem
Moderator: Benj
USB Serial Write Problem
- Attachments
-
- GPS Display Difference.txt
- Log of the 2 terminal inputs
- (3.52 KiB) Downloaded 264 times
-
- Corrupt USB Serial.JPG
- Screen dump of added chars in terminal
- (209.71 KiB) Downloaded 705 times
The only real simulation isn't ...
Gypo
Gypo
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: USB Serial Write Problem
Hello,
It looks like you are sending the 255 (no incoming byte detected) to the PC. You need a if statement to detect if the RS232 GPS byte was 255. If it was then do not send the byte onto the PC. Hopefully this will solve your problem.
It looks like you are sending the 255 (no incoming byte detected) to the PC. You need a if statement to detect if the RS232 GPS byte was 255. If it was then do not send the byte onto the PC. Hopefully this will solve your problem.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel