Has some one R444A01 modbus rtu protocol - modbus

I am looking for something like a datasheet for the R444A01 modbus rtu protocol. I want to implement a tool to read the temperature and the Humidity of this sensor.
the only thing what I could found is something like this: https://www.mikrocontroller.net/attachment/376848/datenBlatt_teil2.pdf
But to implement the tool I miss information about the modbus register definitions like Modbus address, which register stores which information and how many bytes are used.
May someone have some information about this sensor.

https://www.aliexpress.com/item/33054683552.html shows the R444A01 modbus RTU communication protocol. I could not find a proper datasheet either.

Quoting one of the reviewers from https://www.amazon.co.uk/Temperature-Humidity-humidity-temperature-External/dp/B078PHLR4T:
Supply voltage: DC 5-40V (recommended 6.5-28V) MODBUS RTU protocol, 03
read command, 06 write command. Serial port baud rate: 9600 (default),
N, 8, 1
Temperature Register Address 0x0000 (2 bytes) Humidity Register
Address 0x0001 (2 bytes) RS485 Address 0x0002 (2 bytes) Baud Rate
0x0003 (2 bytes)
Baud Rate Table : 0:1200 / 1:2400 / 2:4800 / 3:9600(default) / 4:
19200
Values returned in temperature is a SIGNED two byte value meaning that
a 1 in the highest bit indicates a negative temperature. Divide by 10
(decimal) to get the actual value
Values returned in humidity is an UNSIGNED two byte value. Divide
by 10 (decimal) to get the actual value

Related

Ideal UDP packet size on a reliable (short) network for efficient data transfer

I have a question about the UDP protocol.
I want to stream data from a particle sensor (Xilinx FPGA Dev Board) to a raspberry pi (or Windows 10 laptop) via UDP byte socket as binary data. I don't care if some packets are lost, because there are many particles coming after anyways... But if a packet gets lost, all of the particles information should get lost.
The connection is a short lan cable over the 1 Gbit/s Ethernet port.
The "minimum" amount of data is 192 Bit (24 Byte) per particle (16 x 12 Bit value) and the maximum amount of particles is 3300 per second.
So I have to transfer max. 192 x 3300 = 79200 Byte/s plus Header etc.
Maximum packet size of UDP 65.507 Byte
As I understand the packet size has to be devidable by 24 Byte in my application.
Which leaves me with a packet size range of 24 to 65.496 Byte.
But if the concentration is lower I don't want to wait minutes until a packet is filled and ready to be send.
What would you guys suggust in regard of repitition rate and size?
E.g. a 1008 Byte packet has to be send about every 13 ms at max. particle concentration.
best regards
I just tested a UDP socket with 1024 Byte Buffer, which works nice with strings or Bitvectors for single test packets.

Profibus synchronisation using Linux (Raspberry Pi)

I am planning to develop a simple Profibus master (FDL level) in Linux, more specifically on a Raspberry Pi. I have an RS485 transceiver based on a MAX 481. The master must work on a bus where there are multiple masters.
According to the Profibus specification, you must count the number of '1' bits on the bus to determine when it is time to rotate the access token. Specifically after 11 '1' bits the next frame starts. 11 bits is also exactly one frame.
In Linux, how can I detect these 11 '1' bits? They won't be registered by the driver as there is no start bit. So I need a stream of bits, instead of decoded bytes.
What would be the best approach?
Unfortunately, making use of microcontroller/microprocessor UART is a BAD choice.
You can generate 11 bits setting START_BIT, STOP_BIT, and PARTITY_BIT (even) in your microcontroller UART peripheral. Maybe you will be lucky to receive whole bytes from a datagram without losses.
However, PROFIBUS DP datagram is up to 244 bytes and PROFIBUS DP requires NO IDLE bits between bytes during datagram transmission. You need a UART hardware or UART microcontroller peripheral with a FIFO or register that supports up to 244 bytes - Which is very uncommon, once this requirement is very specific from PROFIBUS.
Another aspect is related to the compatibility of baud rates. Usually, the whole range of PROFIBUS PD baud rates is not fully available on common microcontrollers UART.
My suggestions:
Implement this UART part on FPGA and interface with Raspberry Pi using e.g. SPI. You can decide on the extension of PROFIBUS stack portion you can 'outsource' to FPGA and the part you can keep on RPi.
Use an ASIC (maybe ASPC2, but outdated) and add another compatible processor to implement a deterministic portion of the stack. Later you can interface this processor with your RPi.
Implement using an industrial communication dedicated processor (Like TI Sitara am335x).

Ethernet Type Range

When reading through the Ethernet frame format in IEEE 802.3 , the EtherType was explained as below:
0 - 1500 (Decimal) comes under packet data payload length.
1536(0x600) and above it means the value is determining the type of the frame.(Eg. 0x800 stands for IPV4)
What about the values in between 1501 to 1535? Why these values been left off?
Note: On the Wiki link it is been mentioned it is not defined. But not finding as explanation in any standardized documents.
These values are reserved to avoid ambiguity (e.g. when 802.1Q tagging is used, slightly increasing the frame size).
Using the Ethertype field for the frame length is obsolete though, Ethernet II framing (using the Ethertype field to indicate the protocol carried as payload) far outnumbers any other frame type. Instead, the length of the frame is indicated by carrier loss or a special end-of-frame symbol, depending on the PHY in use.

How to sync microcontroller to MIDI controller output

I am looking to receive MIDI messages to control a microcontroller based synthesizer and I am working on understanding the MIDI protocol so I may implement a MIDI handler. I've read MIDI is transmitted at 31.25kHz without a dedicated clock line - must I sample the line at 31.25kHz with the microcontroller in order to receive MIDI bytes?
The MIDI specification says:
The hardware MIDI interface operates at 31.25 (+/- 1%) Kbaud, asynchronous, with a start bit, 8 data bits (D0 to D7), and a stop bit. […] Bytes are sent LSB first.
This describes a standard UART protocol; you can simply use the UART hardware that most microcontrollers have built in. (The baud rate of 31250 Hz was chosen because it can be easily derived from a 1 Mhz (or multiple) clock.)
If you really wanted to implement the receiver in software, you would sample the input signal at a higher rate to able to reliably detect the level in the middle of each bit; for details, see What exactly is the start bit error in UART? and How does UART know the difference between data bits and start/stop bits?

Xbee Serial port MATLAB

I'm reading data from serial port through MATLAB. The serial port is connected by an XBee module.
I have sucessully read the data and can also send the data correctly. Here's the code; it's quite simple:
s = serial('COM4', 'BaudRate', 9600, 'Terminator', 'CR', 'StopBit', 1, 'Parity', 'None');
fopen(s);
while(1)
while(s.BytesAvailable==0)
end
fprintf(s,'1');
fscanf(s)
s.BytesAvailable
end
So, as you can see at the first stage of the main loop, I'm waiting until data is available in the input buffer. Once the code detects data, immediately a character is sent. However the execution is not fast as I expected. Using an oscilloscope, probes on Xbee DIN and DOUT, I measure 34 ms between when the data is sent to the PC and when the data comes from the PC.
For my application, 34 ms is a critical time.
How can I fix this?
Why do you use USRT (universal serial receiver/transmitter) at 9600 Baud rate?
Your USRT setup, "'BaudRate', 9600, 'StopBit', 1" means one byte (8 bit) of data is transferred by 10 bits (1 start bit, 8 data bit and 1 stop bit) on the wire whose speed is 9600 bit per second, so 960 bytes per second is the maximum speed of data.
It is about one byte per ms (millisecond).
XBee use 5 byte for the header, so its header overhead is about 5 ms.
34 ms is not so bad if you use 25-28 bytes of data. If you use only few bytes of data, you may have another problem.
To improve on this problem, you should use a higher rate for USRT.
If you use the following setup, transmission of your data may be achieved within 3 ms - 4 ms.
s = serial('COM4', 'BaudRate', 115200, 'Terminator', 'CR', 'StopBit', 1, 'Parity', 'None');
I would just change the Baud rate from 9600 to 115200 in your code.