If there is this rs232 wire and it is longer than spec and the baud rates are not compensated for , will there be baud rate mismatch... i.e. the incoming serial bits will be held high or low for shorter ...and you start seeing incorrect messages on the receive side ? is that the same as having a wire with more capacitance or a wire with more interference /cross-talk? , if the message takes longer to reach the receiver without losses, what happens then on the receiver side , is it just message received later then expected?
Related
I am attempting to reverse engineer a device which utilises a serial line to communicate.
I have not currently been able to determine the baud rate of the serial line as of yet. Upon reading the data at a certain baud rate and converting it over to hex, I can see that some of the digits change each time I take a reading.
I am certain that each time I take a reading the device is performing the same action, and should therefore be outputting the same signal.
If I receive different digits each time I take a measurement, would this potentially be a trait of selecting an incorrect baud rate?
I have three interfaces:
RS422
SPI
Ethernet
I’m looking to generate and transmit a variable length message over the interfaces at rates up to 2KHz. I want to code checks to make sure that my output message length can be transmitted at the selected output rate for the settings of the transmission medium. I realise that this depends on the configuration of the different interfaces:
RS422: baud rate
SPI: clock
Ethernet: 10Mbs or 100Mbps
As well as:
Message length
Transmission rate
Can anyone suggest how I can check for these fault conditions?
Measure the bit error rate at various transmission rates and take this into consideration. You can transmit various bit patterns, collect a good sample and analyze the results to pick an ideal message size, transmission rate and integrity check/repair mechanism. Your ideal message size will likely be different for each interface.
I've been reading the input of this RF Receiver by connecting it's DATA pin to an Analog Pin from my Arduino and sending it to the Serial Monitor. If I don't transmit absolutely anything, it reads some noisy input. I already checked that the Analog Pin doesn't introduce any noise by placing a 10K resistor between it and ground. BUT when I do transmit, let's say, a constant ON-OFF pulse train with a delay of 100ms, It reads just as if there was no noise. If I look closely at the Serial Monitor I could notice that none of the zeros got disturbed at all, it's just plain zeroes and 700 (approx). So my conclusion is that the RF Receiver goes crazy if it doesn't detect anything. I've read that you are supposed to transmit some pulse train ALL the time, even if you don't want to transmit anything in particular in order to keep the Receiver at peace, and for it to not mess with your important data. My question is, is there any way to bypass this? The RF Transmitter side is going to be powered by battery, and I suppose that this constant pulse train would drain it pretty quickly. Thank you in advance.
That is normal, the receiver outputs noise.
Those very cheap RF transmitters and receivers have no chip on the RF board that takes care of the protocol (how the radio signal is modulated and how the data is translated to RF data). The Arduino has to do everything, the timing, the protocol, the detection of data, everything.
The transmitter can be turned on and off. That's why it is called ASK modulation (on and off).
The receiver has an automatic gain and receives everything. When nothing is transmitted the receiver increases the gain until it receives a lot of noise. When a digital input is used with an interrupt it could be thousand(s) interrupts per second of useless noise.
To make those work, you need a library that does the transmitting and receiving, including a protocol for the transmitted data. The best library is the VirtualWire/RadioHead. I suggest to use the RadioHead in RH_ASK mode. There are "ask" examples that show how to use the library.
The VirtualWire/RadioHead is really good in detecting a packet of data between the noise.
If you don't want to sacrifice your Arduino for the RF protocol, then you can buy transceiver modules. They have a chip on the RF board that takes care of transmitting and receiving.
In 8051 serial port programming transfers and receives data serially at many different baud rates, But how to increase the baud rate of data transfer in the 8051?
Setting the Serial Port Baud Rate
Once the Serial Port Mode has been configured, the program must configure the serial ports baud rate. This only applies to Serial Port modes 1 and 3. The Baud Rate is determined based on the oscillators frequency when in mode 0 and 2. In mode 0, the baud rate is always the oscillator frequency divided by 12. This means if youre crystal is 11.059Mhz, mode 0 baud rate will always be 921,583 baud. In mode 2 the baud rate is always the oscillator frequency divided by 64, so a 11.059Mhz crystal speed will yield a baud rate of 172,797.
In modes 1 and 3, the baud rate is determined by how frequently timer 1 overflows. The more frequently timer 1 overflows, the higher the baud rate. There are many ways one can cause timer 1 to overflow at a rate that determines a baud rate, but the most common method is to put timer 1 in 8-bit auto-reload mode (timer mode 2) and set a reload value (TH1) that causes Timer 1 to overflow at a frequency appropriate to generate a baud rate.
To determine the value that must be placed in TH1 to generate a given baud rate, we may use the following equation (assuming PCON.7 is clear).
TH1 = 256 - ((Crystal / 384) / Baud)
If PCON.7 is set then the baud rate is effectively doubled, thus the equation becomes:
TH1 = 256 - ((Crystal / 192) / Baud)
http://www.8052.com/tutser.phtml
I have a device running off a different power supply, that I'm trying to talk to serially, it has TX and RX lines, GND and 2.7+ line, its quite grunty so It has its own PS.
I'm getting some odd results at the moment, so wondering if I need to use a common GND between the Arduino GND and the PS GND and the device GND.
Does serial require a common voltage reference point?
Its a mega 2560 R3
All signals require a reference voltage. Ground is what provides this reference for single-ended signals such as those used by a UART.
UART signals are composed of low-level and high-level signals.
The receptor, at the other end, to be able to understand your UART signal, must be aware of what is that low-level and high-level signals.
So you must put your UART GND to the GND of the receptor, and the high-level voltage must correspond to the TTL input level of your receptor.
For example, if the high-level of your UART is 2.7v, and your receptor input-level is 5v, you could encounter bad level detections sometime, because 2.7v could be detected as a low-level input.
For the low-level inputs, this is no problem because 0v is always 0v.
Sorry but... didn't you break your 2.7V device? Besides using a common ground, like Ignacio pointed out, when you have to interface something to something else you should ALWAYS check what are the correct voltage levels expected.
So did you check that the high voltage levels and low voltage levels are fulfilled? I think not. Because:
Arduino Uno (i just have the 328P datasheet on hand, so i'll use this) has an Atmega328P powered at 5V. The datasheet says that the Vih parameter (the minimum voltage sensed as a "high" value) is 0.6Vcc, which means 3V. So if you send him a 2.7V signal.... You are doing something wrong.
The 2.7V device has probably an absolute maximum voltage allowed on any pin of Vcc+0.3V. This means that the maximum voltage for each pin is 3V; if you go above this current starts flowing through the protection diode and... you blow your device. Now you are giving it 5V, so.... Puff...
If the above criteria are not fulfilled you have to put between the two circuits something. Which is
a resistor divider if you have to make the voltage lower (just two resistors) and a couple of transistors to make it higher
Opto-isolators (and you can keep the grounds separated)
Voltage translators (such as TXS0102)
other...