I want to send and receive data with two Lora module but I have only one STM32l4 nucleo board. Is it possible to connect both transmitter and receiver Lora module to this board and have a communication between them?
Yes it should be possible to have both a transmitter and receiver connected to a single MCU. It mostly depends on the availability of pins.
I don't know why you would want to do that as the transceivers are both transmit and receive capable. Such as the Semtech sx1276.
Related
I want to send data through USB between STM32 and Raspberry Pi. I don't want to use USB to Serial convertor, but instead have a actual USB Connection (maybe CDC class). I have to send data at high rate (Full speed). Please guide on how to achieve this?
A USB-serial connector is simply a microcontroller implementing a USB CDC/ACM virtual COM port and bridging to a UART which you would connect to a microcontroller's UART interface.
In your case you can simply implement the CDC/ACM directly on the STM32 using either of its USB device controller peripherals (USB support varies depending on the specific device https://www.st.com/resource/en/application_note/dm00296349-usb-hardware-and-pcb-guidelines-using-stm32-mcus-stmicroelectronics.pdf).
How you actually implement that will depend on what specific part, and what library or framework ecosystem you are using (e.g. SPL, CubeMX, Mbed). There are reference implementations, examples, drivers and libraries for all of these.
Your milage may vary, but I have measured ST's own USB library and example CDC/ACM virtual COM for STM32F1xx on a 72MHz MCU achieving 700kbits/s. Note that the performance is independent of the baud rate you might set on the host when you open the he VCP. Setting the baud rate simply sends a control packet to the device that can be used to set the baud rate of a UART in bridging applications. In your case such control packets can be ignored. There are similar packets for modem control signals such as DTR, RTS, CTS and RI, which you might choose to us for flow control or other signalling.
I've been tasked with figuring out how to get a mobile app to communicate with an MCU then in turn control a stepper motor. Right now I'm trying to get the WiFi module (ESP8266-01) and MCU (NUCLEO-F030R8) to play nice with each other. The catch is I have little to no experience and no education in this field. The closest experience I have is simple Arduino sketches from years ago (IE photo-resistor values driving a stepper motor) and making desktop applications with C#. I am using STM32CubeIDE but if there's a better option I can switch to that.
What I would very much like help on is send and receive simple data between a smartphone and the MCU via the WiFi module. I've read through documentation and other questions but still don't exactly know where to start.
I understand this is probably a large topic in its own right and a short blurb on the internet won't do it (and undoubtedly its multiple subcategories) justice. But I might as well ask.
Sorry if this is too much and thank you in advance.
This project would involve making the following connections.
The UART connection between STM32 and ESP8266.
The WiFi connection between ESP8266 and the mobile.
The application layer protocol between ESP8266 and the application running on the mobile.
For 1, you can actually program the ESP8266 using Arduino IDE and simply connect the UART TX/RX pins of ESP8266 with RX/TX pins of STM32 respectively. You can create a test project in which ESP8266 sends data to STM32 over UART to verify this connection.
For 2, you need to consider the wifi network mode i.e identify whether the wifi connection is going to be ad-hoc (mobile connects to ESP8266 directly) or in infrastructure mode (mobile and ESP8266 connected via a shared access point). You can configure the ESP8266 in both modes. You just have to program the SSID and password of the Wifi network in the ESP8266 (in case of ad-hoc, it is the SSID of the network advertised by ESP8266 and in the infrastructure mode, it is the SSID of the common AP). This wifi functionality is also easily programmable in Arduino IDE for ESP8266.
Finally, once the physical connection has been established between the ESP8266 and mobile device, you need an application-level protocol to connect the application running on the mobile with the ESP8266. You can either use socket connection between ESP8266 and mobile application or use a higher-level communication protocol for IoT devices like MQTT, which is also available in the Arduino IDE.
Final connection diagram could be something like this:
application -> mqtt msgs -> wifi packets -> esp8266 recv pkts -> parse mqtt msgs -> forward data to STM32 over UART
Can a device connected to main processor can initiate a i2c communication.
For example, FAN connected using i2c bus, is it possible for a FAN to send a feedback to main processor.
Common solution to a problem like this is to have a separate interrupt line.
I3C supports in-band interrupts, if you're not set on I2C yet.
i cannot figure this out by myself. What is the point of the RTS (direction) line in the RS485 ModBus communication?
There is no description about it on the internet, all the images in google only show the RX & TX lines but i know that RTS is also used.
Thanks
The only use of RTS in the context of RS485 based communications is so-called RS485 Transceiver Control (see for example the related Docklight RS485 setting). In Microsoft Windows API for serial communications, this mode is called RTS_CONTROL_TOGGLE:
Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low.
It has nothing to do with the 2-wire RS485 bus and the MODBUS application protocol used on such a bus. But some older RS232-to-RS485 (or USB-to-RS485) converters require the RTS signal to be set to high before transmitting any data, and reset it to low for receiving data.
Most standard RS485 interfaces and converters for PC can handle this switch between transmit and receive automatically, so they don't need the RTS at all. Just for example - For the popular MOXA brand this is called ADDC (Automatic Data Direction Control).
I am developing a prototype for adaptive cruise control using two raspberry pi's. I have tested SPI on pi and it works (checked it through loopback). Now i want to write this data to the cotroller. So, after referring to resources i found Socketcan should be used in order to interface can controller with the pi. So i request some one to explain how the communication happens like
1. After writing to spi how the can controller can take that data?
2. If socketcan be used to take data from spi , i need to know how?
Thanks