Serial read/write non standard baud rate

Hi all,

I'm trying to read a 62500bps datastream and print it out through the serial monitor, if i set the baud rate to 62500 to read the stream then i can't write it to the serial monitor as the rate is non standard. What are my options here?

Thanks

You don't say what Arduino you are using, I'm going to guess it's the not one the megas; since if it was you could one of the other hardware serial ports to talk to the computer.
This leaves two question you need to answer, does the 328 support the speed, and how to get the data to the computer.
Looking at the datasheet for the ATmega328 it looks like the hardware will support reading at this rate (look at page 180 if you want to verify this for yourself).

On the second part, you've verified that you can't get your computer to read 62500bps? if so to get the data to the computer, you could use newsoftserial or softserial to create a second serial port in software, problem here is the maximum transmission speed for either library is less than the speed of the serial stream you are receiving. If you could live with a taking a small sample of the input data and store it in memory then send it out at a slower rate, this would be possible, and fairly easy.

If taking a short sample won't work for you, then you may want to look into a different chip. The mega would easily handle this with it's 4 hardware usarts. If they mega is too large/expensive/whatever you could look into using a sanguino, it uses an ATmega644, which has two hardware usarts, but still uses a dip package (albeit with 40 pins).

If you told us a little more about what you're trying to do it would help us help you.

Thanks for the reply.

I'm using an UNO so only one hardware serial. Since posting i did seek out alternative serial monitors that would read at 62500bps but these weren't giving me the expected output. The input is a datastream of 39 bytes starting with FF 00 and ending with EE.

The code i'm using is a slightly modified version of the example from Serial.read on here.

int incomingByte = 0;	// for incoming serial data

void setup() {
	Serial.begin(62500);	// opens serial port, sets data rate to 62500 bps
}

void loop() {

	// send data only when you receive data:
	if (Serial.available() > 0) {
		// read the incoming byte:
		incomingByte = Serial.read();

		// say what you got:
		Serial.println(incomingByte, HEX);
	}
}

It had crossed my mind to stick a couple of values into an array then print them out but i never tried to implement it.

Thanks

Hello.I have the same question.
I need to read with my arduino mega 2560 on serial port a car ecu serial diagnose stream who is send with 62500 baudrate and send to my computer where i have a capture software for evaluate parameters.
Please help us with some ideeas.Thanks a lot.

tao13:
Hello.I have the same question.
I need to read with my arduino mega 2560 on serial port a car ecu serial diagnose stream who is send with 62500 baudrate and send to my computer where i have a capture software for evaluate parameters.
Please help us with some ideeas.Thanks a lot.

How is the Arduino involved? Can't you just run your acquisition software on a laptop and connect that to the serial stream from the ECU? I don't see what the Arduino is adding here.

Chet, please refer to Peter's answer. In case you just have to use your arduino, on the computer, use Termite 2.6 and type in the non-typical baud rate and give it a try.

Hello and Thanks to all for your answer.
If i read directly with my pc on serial port i must select a standard rate(termite do the same and ignore what i type in rate control), and all what i received are wrong.
I want to use an arduino to read with it at the 62500 baud rate and send to pc with a standard rate 115000.
Thanks again and if you have another solution please give it to me.

From things I have read, most ECUs require a start communication procedure. If you don't initiate communication properly you get nothing. Do you know what protocol you need to have to read from the ECU?

Hello.
It is an old ecu model from 85' (not obd or obd2) from renault 21 turbo.It sent on one wire an array of bytes.I don't think it must initiate in some mode.It send a start and stop character.This it what i know and on this instruction i made my software for capture bytes and evaluate and display them.
Thanks again.

Just an idea,

What about using the arduino hardware serial on this old device and use soft serial with bluetooth serial adapter shield. As long as the old device is not spitting data like mad, you should be able to handle both. You will need a bluetooth dongle on your PC if it doesn't yet have a bluetooth link.

This it what i said about use an arduino.
I want to connect arduino to ecu for read (but here i read on forum that arduino can read on 62500 with clock speed modification, but i don't know how can i setup this), and on other serial port send to my pc with other speed(standard speed,maybe high than 62500 like as 115200).
Thanks again.

Did you also say "use a bluetooth serial"? You can either get a bluetooth shield and bluetooth bee or get an arduino Mega, which has 4 hardware serials.

i don't want to use an bluet.I have an arduino 2560 and this is what i want to do , one serial read from ecu with 62500 baud and other send to pc but with standard baudrate.

tao13:
i don't want to use an bluet.I have an arduino 2560 and this is what i want to do , one serial read from ecu with 62500 baud and other send to pc but with standard baudrate.

OK I didn't know you have a mega. Have you tried the mega? You said you used an UNO and it didn't work. UNO's chip has only one hardware serial. Software serial won't work reliably above something possibly 38400.

Hello from a biginner.
Any progress done about this subject?
Regards.

Spaceman88, you may want to start your own thread explaining your problem(s), hardware you are using, and what you have tried.

In relation to software serial here is an excellent thread about the subject. http://arduino.cc/forum/index.php/topic,138497.0.html