Capturing custom baud rate

Hi

I have an old TV decoder here which talks to smart cards at an oddball baud rate of 10000. When I try capturing traffic at the standard rate of 9600 baud, all bytes are shifted by a bit or two.

This is mostly correctable in software but some data bits go AWOL or replaced by start/stop/parity bits.

I am wondering if there's a software UART for the Uno that can listen at 10000 baud? I can capture that and send via serial monitor over the hardware UART at whatever standard speed I like.

I have a hard time understanding the timings of hits so wouldn't know where to start if starting from scratch.

Any help appreciated.

Why does it have to be a software USART?
Why not one of the hardware ones?

Set the hardware UART for the correct baud rate. The ATmega328 processor data sheet has the details.

Doesn't the HardwareSerial calculation get close enough?

Who knows? If not, the settings are described in the UART section of the ATmega328 data sheet.

Hardware does not support 10000 baud. If it does, show me where it says that in the data sheet.

Additionally, the serial monitor does not have 10000 baud as the option...

I thought you said the data was coming from some TV device?

You can probably get close.
What's to lose by trying?

If you are really keen on this project and willing to spend the time, Google "uart" and study the Wikipedia entry. At the end of the article is a list of a whole bunch of UART chips. One or more will fit your project, if you include an appropriate clock frequency to control the UART. Not hard to make a UART/clock board by hand.

1 Like

Go to the data sheet section 20. Particularly table 20-1 that has the equations to set the baud rate.

1 Like

I did... Please read my original post for results

I did read it but didn't see the bit where you wrote in the code you didn't post

<SomeSerialObject>.begin (10000);

You're right. I should have posted the code but it really is quite basic. It does have serial.start(10000) but getting broken bytes.

Perhaps the baud isn't quite 10k... I'll give it a try with nearby rates.

Don't forget, if you're talking to the device at 10k, you want to be printing the results to the serial monitor at at least twice that rate.
I usually default to 115200 for host comms.

This is what I don't understand. I thought the serial monitor has to run at the same rate as the speed that it's been setup as (unless I have two hardware UARTs which Uno doesn't).

Or am I missing something?

Ah, so you are using an UNO. Does the software serial library you are using not support arbitrary baud rates?

I tend to use AltSoftSerial which I believe does handle oddball baud rates.

That's what I was trying to ask. Whether I needed a fancy software serial to read traffic at oddball rates and read out via the hardware one.

I suggest you get a board with at least 1 spare hardware serial port, for example a Mega or a Nano Every. Possibly worth reading the data sheet of the relevant processor before ordering to make sure you are in with a chance of getting the required Baud rate.

Trying to do this with one serial port for both the serial monitor and the thing you are connecting to is never going to work.

Thanks all. I got myself Arduino Mega with 4(!) serial ports. I am using one for sniffing data and another for sending that data to serial monitor.

I've since found that the baud rate of the device is actually 10300, not 10000, which made a difference....!

Many thanks for advice!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.