How maximum baudrate will be determined for i2c - i2c

I've seen standard baud for typicall i2c is 100k ,fast mode 400k
How one can determine it?

These numbers are defined in the I2C standard, published by NXP (previously Philips).
In practice the limits are defined by hardware, you would have to ask on Electronics stack exchange about that.

Related

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).

I2C slave implementation - clock frequency?

I want to implement a I2C SLAVE in an FPGA, just for learning purposes. I read in the I2C specification that for the FAST mode there is a timing parameter tPS = 50ns (max) which means "pulse width of spikes that must be suppressed by the input filter". Should this be a digital filter inside the slave? If yes, does that mean my slave must have a maximum clock period of 25ns (or something)?
Another question would be: is there a (robust) way of implementing this slave using the SCL line as the only clock? Or a faster second clock is needed (and in this case I would treat the SCL line as "data")? If so, how do I calculate the minimum frequency of this other clock?
Thanks in advance!

how to do USART communication please tell me everything which should be taken care to do usart communication

I am Using Atollic and cubemx on ubuntu.
Your question deserves a tutorial by its own, but in short you need to
Define the pins for both RX and TX
Define your protocol options [ baud rate, parity, crc..]
Calculate the prescaleers (USARTDIV) according to you src clock and baudrate
define whether or not you need interrupts for reception or transmission
Please take a look to the book Mastering STM32 by Carmine Noviello.
Also read the section of STM32 user manual Page 785 chapter 27

STM32 SPI bandwith evaluation procedure

I'm testing the SPI capabilities of STM32H7. For this I'm using the SPI examples provided in STM32CubeH7 on 2 Nucleo-H743ZI boards. I will perhaps not keep this code in my own development, rigth now the goal is to understand how SPI is working and what bandwith I can get in the different modes (with DMA, with cache enabled or not, etc...).
I'd like to share the figures I've computed, as it doesn't seem very high. In the example, if I understood correctly, the CPU is # 400Mhz and the SPI bus frequency # 100MHz.
For polling mode I've measured the number of cycles of the call to function HAL_SPI_TransmitReceive.
For DMA I've measured between call to HAL_SPI_TransmitReceive_DMA and call to the transfer complete callback.
Measurements of cycles where made with SysTick clocked on internal clock. Since there is no low power usage, it should be accurate.
I've just modified ST's examples to send a buffer of 1KB.
I get around 200.000 CPU cycles in polling mode, which means around 2MB/s
And around 3MB/s in DMA mode.
Since the SPI clock runs at 100Mhz I would have expected much more, especially in DMA mode, what do you think ? Is there something wrong in my test procedure ?

Serial Port Communication understanding

i need some help understanding a specific serial port connection from a sensor. I need to read data from the sensor and make some calculations in matlab or c++ (i will decide later)
The manufacturer only gives a chart with the following details:
Sensor Serial Port
Pin Number Mode Pin Description
I Trigger Input
I RS-232 Receive
O RS-232 Transmit
PWR Sensor Power (DTR)
PWR/GND Signal Ground
Not Used (Reserved)
Not Used (Reserved)
I/O RS-485 B Signal Pin
I/O RS-485 A Signal Pin**
So my question is: OK i know that pin 2 is used to receive data but how am i going to decode the volts stream into integers for example for my program? Also, i know that pin 4 gives power to the sensor. How do i know how many volts it has to give? Generally how am i going to learn all these details since the manufacturer does not give it?
Do you think Serial Port Analyzer Software will help?
Thanks very much in advance.
You might want to search for "DE-9 pinout YourSensorNameHere" in google or This page might be of some use to you. With most RS-232 you only need pins 2,3 and 5. With out more specifics about your sensor there isn't much SO can do for you.