Why Do we need Isolated USB to TTL converter cable for communication between Desktop CPU and target? - embedded

We can use non-isolated USB to TTL cable in between battery operated devices, But when we are dealing with AC devices like communication between Desktop CPU and Electric meter(Embedded MCU), we need isolated USB to TTL converter. Any one please help why we need that in this case?

Related

Can I use ESP32-S3 as USB HUB or USB HOST for USB data communication?

I have a system consisting of a computer and various sensors. The sensors have a USB communication interface. I want to design GPIO and communication card between computer and sensors. I want to read the data from the sensor (Usb interface) with a microprocessor (ESP32-S3), pass it through various processes and send it to the computer (Usb interface). I have tried usb CDC ACM and HID sample codes but failed. Can I use ESP32-S3 as USB HUB or USB HOST for USB data communication? If possible, where could I be making a mistake?
I programmed an Esp32-S3 as if it were a sensor. With another Esp32-S3, I was able to send the data I received with the USb protocol to the computer. But I was not successful with other sensors.

How does USB integration work from the device end?

Hopefully I will have more luck today. I have no prior USB integration and about 8 months of learning embedded systems on Atmel devices. I am trying to use an Atmel SAM L series to connect over USB to a computer. The use case is for data transfer. Specifically, the MCU will be gathering data from it's sensors and packaging it for USB transfer.
I have searched through and read up on all of Atmel's included USB examples. I have also started reading through usb.org's class specifications for CDC.
I have running now something that lets me send data along one com port, into the target usb and then out the debugger usb to another com port. However, I don't think this is real USB.
My problem is two fold.
1.) I do not fully understand what differentiates USB from serial communication on a com port.
2.) Even if I were doing it correctly, I'm not sure how to test and verify that I have indeed created a legitimate USB device that can be accepted by a host computer.
Links to documentation(Atmel or generic) or example code would be appreciated.
1) USB is defined in the USB specifications from http://www.usb.org. Serial ports were an older and simpler interface that involved sending data back and forth asynchonously on pins with names like TX and RX. The USB CDC class and its ACM subclass allow you to make a USB device that emulates a serial port. If you make your device be a USB CDC ACM device, then you don't need to supply any drivers for Windows 10, Linux, or Mac OS X.
2) You can read the USB specification and the CDC ACM specification. You can run the USB command verifier. You can test your device with a variety of different USB hosts to make sure it works.

How can I program ST MCUs from USB disk without PC?

I want to program (such as STM32F407 cortex M4 MCU) without PC, by using only MCU board, USB disk and USB cable. Binary(.HEX) file should be stored in USB disk. then bootloader which preloaded in MCU, should load binary file from usb to the program memory.
Is it possible to do it, as I describe above?
Yes it is entirely possible given a suitable boot loader. I have implemented a boot loader on STM32 that accepts updates over serial, SD card or USB VCP; adding USB mass storage support would be a relatively simple extension.
Your boot loader will require USB mass storage device support, for which the USB controller must support operation as a USB host, and you will require a file system (could be read-only to reduce size). You will also need to support flash programming.

Connecting multiple usb peripherals to a FPGA

I want to connect a USB peripherals to a FPGA. Basically FPGA should act like an USB host. Is there a FPGA board support a USB hub so that one could connect multiple(upto 4) USB peripherals at a time.
I have a Digilent Nexys3 fpga which is based on Spartan 6. It supports only one USB device (keyboard or mouse). It doesn't support a hub. I have found Cypress host controllers, but I am not sure how to use it in a FPGA.
You need to have a USB host controller inside your FPGA, such IP is not freely available, one alternative is to use a Zynq based (for Xilinx) or Cyclone V based (for Altera) board. Those have integrated USB controllers connected to their dual ARM core.
You can find more info about those at:
Altera Cyclone V
Xilinx Zynq
You maybe able to use an external host controller but then you have to connect it to your FPGA and that is usually requires a lot of IOs and those modules are more expensive than buying a Zed board ($395) or Cyclone V board ($450).

Integrate microcontroller with 3G dongle

I want to integrate a Luminary microcontroller with a 3G USB dongle.
Do all USB dongles support AT commands?
If not then what is the best way to do it?
Thanks..
Yes, you can expect that the 3G dongle will support AT commands. You need the modem (dongle) to make a modem port available, to which you can send AT commands. For this, you need a suitable driver, and maybe some software to convert the dongle from a USB mass storage device to a modem, depending upon your device. (When you first plug the modem in, it may be seen as a mass storage device, and must be converted to a modem)
Ask the manufacturer for details, as this is not a standard procedure, and implementation is manufacturer specific.