I have a raptor kit utilizing the RS232 to communicate to a different board. When the raptor is plugged in to my computer via the USB and it also has full time power, it works great. As soon as I unplug the USB cable, it stops working. My best guess is that packets are being dropped since it will only do an operation if the message transmitted is a certain length.
Has anybody experienced something similar? Any suggestions.
The other device is running a PIC18. It is a board that has been in production for a while.
The ground is connected from the DB9 pin 5 connector to the ground on the other device. Pin 2 and 3 are connected to the other device RX to TX. Pin 4 is connected to 6 and pin 7 is connected 8. Pin 1 and 9 are not connected to anything.
Another issue I noticed when running in debug mode is that packets are missing. For example if I’m sending the string [01234567890123456789, I only see on the debug screen a partial version of what I sent. Also if I continuously keep sending data, at some point it stops responding completely and the data event does not trigger.
if you’re using debug.print to make sure you get the data you need, then you’re probably overloading the processor with string manipulation. That gradual slowdown/lack of response I think is typical of a backlog of queued data not being able to be processed.
What baud rate are you using, and what sustained data rates are you expecting? Remember, working in strings here is bad. Work in byte arrays as long as you can.
I agree that string manipulation can cause a problem. I had changed the way data is handled and just use bytes but it was still dropping bytes from the message.
I had slowed it down to 9600 from 115200 and the problem persists. However, I found out in this topic the use of flush when receiving https://www.ghielectronics.com/docs/15/uart I added that to my software and it has fixed the issue, packets are no longer dropping.
I’m currently testing it to see what kind of data rates can be done. For this initial solution, the amount of data being transferred is low but if I use it for a different product, it will need to handle large amounts of data transferred.