Can't read slow (100 bps) serial data

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to read the serial data from a controller. The serial data from the signal bus is 100 bits per sec(bps) and the vcc is 12 volt. There is only one serial wire. Each packet is 13 bytes. And each byte has one start-bit, one stop-bit, no parity bit, and 8-bit payload/data.

I first tried to read the data with TTL to USB converter which has CP2102. But it didn't give me any data. CP2102 has a minimum working baud rate of 300. Then I tried to use the digital I/O pin of the Arduino using blind sampling. And sometimes it works sometimes I get messy data.

I need your help in figuring this out. Are there any off-the-shelf modules like TTL to USB converter I can use which can read a slow baud rate of 100 bps serial data?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What hardware needs to read this data? Is it a micro or a PC?

 

You write that it is "one wire". Does it receive and transmit on the same wire? Is it, by any chance, SDI?

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The PL-2303HX goes down to 75 baud.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to read the serial data from a controller. The serial data from the signal bus is 100 bits per sec(bps) and the vcc is 12 volt. 

can you speed it up?  Maybe not, sounds like an automotive sender of some sort.

 

Anyhow, the AVR can certainly sample and decode a waveform that slowly...sounds like you were close in doing so...keep at it.    It might be so slow, any timer you used was overflowing...so look at that.

 

But why bother with sampling, just use the built in AVR uart & let it do the decode.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then I tried to use the digital I/O pin of the Arduino using blind sampling. And sometimes it works sometimes I get messy data.

I see no reason that a "software-serial" sort of driver on Arduino (or equivalent) shouldn't work, though you may need some tweaking to get accurate timing.

You could also use an AVR running a 4MHz to do a simple "speed conversion" to something more reasonable.  In fact, I designed a simple PCB with exactly that sort of application in mind - it uses a ATtiny1634 (which has two hardware UARTS), provides a couple of rs232 drivers, and breaks out some pins.  https://hackaday.io/project/1976...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asif_johan wrote:

...and the vcc is 12 volt...I first tried to read the data with TTL to USB converter...Then I tried to use the digital I/O pin of the Arduino...

 

How did you reduce the 12V down to5V to prevent damage to your USB converter and Arduino?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asif_johan wrote:
and the vcc is 12 volt.

Well there's your problem - You've blown up your CP2102N and probably the I/O pin on your Arduino.

 

Do you have an oscilloscope ?

A picture of the output waveform from this 12V controller would be useful.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it 0V and12V or -12V and 12V (RS232)? 

And how do you make sure that the levels on the Arduino is correct ? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for replying.

I am trying to only read from the bus.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for the suggestion

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for the suggestion. It is a HVAC signal, so I can't speed it up.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using a level shifter to convert the voltage to 3.3V.

Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



It is a HVAC signal, so I can't speed it up.

Of course you can.  You're would not be speeding up the HVAC equipment itself, just the serial data FROM the equipment, so that it could be easily read by "more standard, modern, devices.  Sure, the microprocessor you use to "just speed up" the communications could probably do a lot more, but you're looking at something like a less than $10 board with trivial code, and I think it makes sense to separate it from other functionality.

 

My first work HW project out of university was a circuit to convert a 75bps 6bit newswire feed into something the local mainframe (ascii based) could understand.  So I connected two hd6402 UARTs back-to-back on their parallel interfaces with one configured for 75bps 6bit. and the other configured for 300bps 8bit. (plus level shifters)  A byte would come in on the 75bps uart, a tiny bit of logic would strobe the 300bps UART, and the byte would go out a 300bps, though the standard mainframe access ports.

 

 

(Although if you're going straight to USB, you might consider one of the SAMD boards, like a Seeed Xiao or Adafruit "QT Py."  I believe you should be able to set up their HW serial port with a lower-speed clock to get whatever sort of serial bit rate you want, while operating the rest of the CPU (and USB) at the full 48MHz.)