Is frequency output more robust against noise than a digital interface like SPI?

Thread Starter

electrosn

Joined Jun 9, 2022
14
Hello! The other day I was reading that the output of a sensor reading in frequency was more appropriate for noisy settings than an interface like SPI and also analog signals.

I can understand why it would be better than analog signals, but why is it more robust than SPI or other common digital interfaces? Is it because missing one or two counts of a frequency output is less problematic than missing a bit that might be more significant in these other protooals?
 

MrChips

Joined Oct 2, 2009
30,707
Welcome to AAC!

You are correct. The answer is yes and no. Yes, digital signals are less affected by noise than analog signals.
No, a digital frequency is not better than digital interfaces. It depends on the nature of the noise and how it is presented on the signal. Digital signalling might include error detection and correction which makes it very robust.

Imagine communicating with the James Webb Space Telescope 1.5 million km away with 40W transmitter power.
 

Papabravo

Joined Feb 24, 2006
21,159
Taking a deeper dive into the reliability of a digital interface like SPI you can start with looking at:
  1. The voltage levels of the transmitter along with the source impedance of the driver.
  2. The receiver thresholds and input impedance of the receiver
  3. The characteristics of the transmission line between transmitter and receiver, including series resistance, series inductance, and parallel capacitance.
It is fairly easy to convince yourself that for 3.3V to 5V levels on a board with reasonable trace lengths of 4-8 inches, that SPI is a robust interface. Your environment and mileage may vary.
 

Ian0

Joined Aug 7, 2020
9,667
CANbus is used in noisy environments like automotive, because it is a balanced system which can hugely reduce common-mode noise, and because it has a checksum and automatic retransmission.
 

Papabravo

Joined Feb 24, 2006
21,159
CANbus is used in noisy environments like automotive, because it is a balanced system which can hugely reduce common-mode noise, and because it has a checksum and automatic retransmission.
Not to mention that a transmitter receives its own transmissions and can detect transmission errors on a bit-by-bit basis. It is common in debugging a communications system to "step" on a bit stream in various ways to test error detection and correction. You cannot do this with CAN because as soon as a transmitter fails to hear, what it knows it sent, it will throw an ERROR frame immediately before even getting around to checking the CRC. In all the years I've worked with CAN I have never seen or been able to generate a CRC error.

I did consider an FPGA that generated CAN frames with a bogus CRC, but that was too much effort for a very minimal payoff.
 

Ian0

Joined Aug 7, 2020
9,667
I've used CAN on both NXP and Renesas microcontrollers. In both cases it was a complete pain in the bum to set up, but well worth the effort, as once it's going it takes almost no software overhead, because the peripheral schedules transmission, re-sends if there is a data collision and almost never makes an error.
 

MisterBill2

Joined Jan 23, 2018
18,167
"Is a frequency better than a digital signal???"
That very much depends o a lot of things. First it is the information rate. If you are sending high resolution video then under most conditions the normal digital scheme for sending the signal will be the better choice. Butif you are sending a single variable with a data rate in the audio frequency range through an area with a very high electrical noise level, than a frequency that can be sent at a level of many volts above the noise level will be the better choice. OR, send the digital signal over a fiber optic link.
 

nsaspook

Joined Aug 27, 2009
13,079
"Is a frequency better than a digital signal???" No, it's done because it was cheap in cost and implementation (Voltage-to-Frequency) years ago circuit wise compared to modern digital coded methods with FEC, CRC and other error correction technologies in one tiny chip.
Things like incremental rotary encoders are frequency output devices because that's the natural state of the encoded signal.
 

MisterBill2

Joined Jan 23, 2018
18,167
"Frequency" can be used at a much higher voltage than most digital signals commonly use. a 3.3 volt digital signal in a 100 volt noise field will have problems, while the 150 volt frequency will be easy to separate. And if the signal needs to be wireless in a high noise field then frequency may be easier to recover.
So just like a good hammer is not the correct tool for every job, the selection will depend on the situation, like I said much earlier in this thread. "One size seldom fits all comfortably."
 

nsaspook

Joined Aug 27, 2009
13,079
The day for high voltage digital passed with mechanical teletype of 60ma 120 volt DC loops. We switched to 'low-level' twisted differential TTY signalling in the 70's and use ± 2.5 V Ethernet Gbit/s signals on non-shielded cable for hundreds of meters in industrial settings. "Frequency" encoding is a vestige of a bygone era where it was better than analog over long distances. That doesn't mean is doesn't work, it only means that technology advances.
 

MisterBill2

Joined Jan 23, 2018
18,167
Probably you never came across high level noise, it appears. not common mode with high level motor and SCR hash. There is a time and a place for each. Fiber optic connections were the answer.
 

nsaspook

Joined Aug 27, 2009
13,079
Probably you never came across high level noise, it appears. not common mode with high level motor and SCR hash. There is a time and a place for each. Fiber optic connections were the answer.
You're kidding right? I work on systems that still use vacuum tubes because of high voltage noise generation. I'm very familiar 3-phase 100KVA+ machine control systems with high voltage DC, high current DC, motors, compressors, fans and just about every possible other noise source. Fiber is great for isolation but it still uses pulse code modulation for data transmission, not frequency encoding in modern systems.
 

MisterBill2

Joined Jan 23, 2018
18,167
Why attack when the application the TS has is unknown?? If the application is reading the RPM of something then the data may already be in a frequency format.
 

nsaspook

Joined Aug 27, 2009
13,079
Why attack when the application the TS has is unknown?? If the application is reading the RPM of something then the data may already be in a frequency format.
It's not an attack, it's a very informed opinion from decades of experience using analog, frequency and data based sensors on systems that blow-up things in cool ways. ;)
https://forum.allaboutcircuits.com/threads/board-burns.153544/post-1591374

"If the application is reading the RPM of something" Exactly right. That's why I said: "Things like incremental rotary encoders are frequency output devices because that's the natural state of the encoded signal." Today there are SPI or coded interface rotational position devices.
https://www.cuidevices.com/blog/int...s-an-overview-of-spi-rs-485-and-ssi-protocols
Another important aspect is to consider how the encoder connects to the host system and, in particular, the most suitable communication interface. Suppliers can offer parts with a wide variety of outputs ranging from simple TTL outputs to industrial Ethernet or proprietary standards. Familiar serial interface standards are among the most popular and widely used, including RS-485 (aka TIA/EIA-485), SPI (Serial Peripheral Interface) and SSI (Synchronous Serial Interface). Designers' choices can be governed by the interface available at the host system, as well as factors such as protocol latency, maximum data rate, the connection distance between the encoder and host, and the required level of noise immunity.
https://www.dynapar.com/technology/encoder_basics/biss_encoders/
BiSS Encoder Communication Format
BiSS has two modes; sensor mode and register mode. In sensor mode, the sensor or encoder communicates in a manner similar to SSI. The master begins to send a stream of clock pulses. Eventually the data line level will drop low and data sampling will begin. The data can be received and clocked at 10MHz. Due to the transmission speed, many drives may not require additional analog incremental outputs to control motor speed. Since SSI has a slower max transfer rate of 1.5MHz, compared to 10MHz for BiSS encoders, the propagation and calculation delay is less than a full pulse width. This is how BiSS is capable of hardware compatibility with SSI. Only the data length and framework need to be changed in the software.
 
Top