0

Setup:

Problem description

The bits sent out by Pololu to ESP get scrambled now and then, but not all the time.

As an example, when Pololu sends decimal 48, ESP receives either 152 or 176 for those instances when the bits get scrambled. Binary representation:

48 = 0 0 1 1 0 0 0 0 : correct

152 = 1 0 0 1 1 0 0 0 : incorrect

176 = 1 0 1 1 0 0 0 0 : incorrect

Since the bits get scrambled, I'd expect the ESP to receive random combinations of 0's and 1's. But incorrect data always being either 152 or 176 makes me think there's a pattern I'm not seeing. And it's that pattern which if I can spot will give me an idea of how to solve this issue.

Additional context: Pololu actuates a few motors (of course via motor drivers) and sends a 48 as a SUCCESS signal to indicate motor operation has completed successfully. So it's not so much streaming of data but more of an "event-based" transmission. For the times when 48 is incorrectly received as 152 or 176, the motors still actuate as expected.

I'm looking for some thoughts and suggestions on how to go about finding the cause of this issue. If necessary information is missing please mention in the comments and I'll add more details.

  • 1
    Looks like your software-serial is not maintaining a sufficiently stable sampling period to match up with the baud rate. It looks like it's sampling too slow overall causing it to see the `1` stop bit on the end as if it's the data byte MSbit. – brhans Aug 26 '21 at 15:50
  • 2
    What happens if you use a different sender, such as a laptop? What happens if you disconnect the motors so you don't get a current surge? What happens if you use a different receiver, such as a laptop? What happens if you use a slower data rate, such as 1200 baud? – Elliot Alderson Aug 26 '21 at 15:56
  • How is the schematic, is the motors influencing the serial comm.? – MatsK Aug 27 '21 at 06:57
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 27 '21 at 06:57

0 Answers0