Go Down

Topic: SoftwareSerial - Servo - garbage (Read 666 times) previous topic - next topic

Djnardy01

Sep 17, 2016, 12:26 pm Last Edit: Sep 17, 2016, 03:33 pm by Djnardy01
Well... this is my third topic for this issue.. but slowly it's goind better...
Oki. My project "map" is this:

ATTiny85 ->Arduino Mega2560 -> Bluetooth ~> Bluetooth -> Arduino Mega2560 ->RaspBerry Pi3.

Remote controlled  car side:

ATTiny85: Using SoftwareSerial, 19200 baud, only TX wire, is connected to a hall sensor to calculate the RPM of a shaft.

Arduino Mega2560: Read some sensors, all 4 Serials used (USB, only for debug, Serial1 bluetooth, Serial2 ATTiny85, TX only, read RPM from the car, Serial3 another ATTIny85, to control some LEDs.)

Remote side:

Arduino Mega2560: wich reads the throttle pot, direction pot, some other commands, and is connected to a raspberry pi via USB, and to bluetooth module via Serial1.

Raspberry Pi: my TouchScreen GUI for the remote.
________________________________________________
Up here almost everything works properly

Now the problem is:

If you spin the weels by hand (no motor attached to the car) the little Attiny sends the correct RPM to the remote.

So far so good.

If I attach the motor to the car and I use the throttle/ESC, BOOM, That part of string from attiny, first show some garbage, and after a short period of time, that string gets null. And the both Arduinos freeze..

I use only strings to transfer data, No floats, No negative values. that strings contain only unsigned integers...

Ah.. and the GUI is created in Processing. I've seen that symbols Only from Attiny in the Processing console.

Any Ideas ? :(


EDIT: I've tried to use Servo.detach() after sending data to arduino and attach() it after sending complete.

The processing console looks like this then motor starts to spin
Code: [Select]
From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1--1-4-0-0-00000-0-0-0-00000-x

From: 1-�i76����0g8-1-4-0-0-00000-0-0-0-00000-x

From: 1-95���S���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-XSնM�86���-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x

From: 1-0-1-4-0-0-00000-0-0-0-00000-x



That symbols comes only from Serial2.

I've taken a screenshot of processing, if can help anyone..

Go Up