December 10, 20187 yr 41 minutes ago, SilverNodashi said: In the case of electronics like an inverter I would thinks it's still quicker than serial communications? On an Arduino, for example, I can communicate much quicker than 2400pbs, and in fact in many instances (like a GPS tracker) anything below 115200 is too slow to get all the data quick enough. Microprocessors have real time processing. An Arduino, as example again, runs at 16Mhz - that's 1/16000000 of a second that it could run an instruction. Some instructions run on two cycles, and some on three, but that's still super fast. Computers are faster but due to multiprocessing things could happen slower, depending on how many threads, and cores are being used. For GPS, USB is considered inferior to RS232 because of the unpredictable latency. Pulse-per-second + RS232 is the gold standard (pretty much a crude type of SPI implementation). At least if you care about accuracy Also 115200 is not the maximum speed supported by most RS232 implementations Most stratum-1 low cost time servers that are considered good are using GPS + pulse per second. You can even build your own incredible accurate time server (ns drift) using a GPS and RS232. With USB you are looking at seconds accuracy. Obviously the best stratum-1 servers are using atomic clocks but a GPS module gets pretty close (GPS satellites themselves have incredible accurate atomic clocks). You can't get accurate location data without an incredible accurate clock. TL;DR: RS232 is better unless you need bandwidth but on the Axpert, bandwidth is not the problem Edited December 10, 20187 yr by Gnome
December 10, 20187 yr 2 hours ago, Gnome said: Several things to note about USB: USB doesn't have any kind of synchronous protocol Sure the actual data transfer is full-duplex but the protocol itself is asynchronous model You tell the USB controller to send packets to the device and it'll send it when it is good and ready The device then responds to the controller which will notify VIA an IRQ again when it is ready USB has higher latency and unpredictable latency Because of the above, USB is not used for time critical applications like GPS and time sources RS232 is still considered superior in this space Now as for RS232 it does not have the bandwidth that USB has but it has lower latency. Other than parallel there is no lower latency protocol (OK there is SPI but it isn't well supported). Not only that, the actual latency is 100% predictable and repeatable. Meaning if you are running a real-time operating system (which we are not), you can exactly time your RS232 on clock cycles with relative accuracy (some accommodation must be made for clock drift on the order of μs, but compared to USB it is orders of magnitude better). Lastly, the Axpert device isn't limited by the speed of the RS232, it is limited by the device. 2400bps is as good as it gets. I've got a library I wrote that allows both USB & RS232 to be used for Axpert. The library is otherwise using the exact same code. The total latency is exactly the same between the two ± 15ms. I found USB to be less reliable on the Axpert. Doing things wrong on USB I was able to cause the inverter to stop responding to commands which required a restart (mind you the inverter still ran normally). But on RS232 it was more reliable. Interesting that you mention this, as I noticed this on a client's Inverter. He has 3 Infinisolar inverters, all running the same firmware with 3 x Raspberry Pi's, 3x new Sandisk MicroSD cards and 3 identical (bar different IP address and hostname) of ICC. The one would randomly stop collecting data and a reboot of the Pie fix it. A new cable didn't help, nor reinstalling Linux and ICC so it's probably the USB port on the inverter.
December 10, 20187 yr 2 hours ago, Gnome said: For GPS, USB is considered inferior to RS232 because of the unpredictable latency. Pulse-per-second + RS232 is the gold standard (pretty much a crude type of SPI implementation). At least if you care about accuracy Also 115200 is not the maximum speed supported by most RS232 implementations Most stratum-1 low cost time servers that are considered good are using GPS + pulse per second. You can even build your own incredible accurate time server (ns drift) using a GPS and RS232. With USB you are looking at seconds accuracy. Obviously the best stratum-1 servers are using atomic clocks but a GPS module gets pretty close (GPS satellites themselves have incredible accurate atomic clocks). You can't get accurate location data without an incredible accurate clock. TL;DR: RS232 is better unless you need bandwidth but on the Axpert, bandwidth is not the problem My GPS applications don't run over USB but rather over serial. Well, it's connected directly to the Arduino's serial pins. But I noticed that if I run my serial monitor at anything slower than 115200, I don't get all the data - even though it's read by the Arduino as I can see it in the data logging app.
December 10, 20187 yr Short answer: Just because you can (communicate fast) doesn't mean you have to :-) And that's why we have DMA controllers (and similar things offloading the dumb work of moving data) and interrupts. You can literally tell some cheap chip somewhere "hey you send this 1024k and tell me when you're done!" and in the computer equivalent of a century (because the cpu is so much faster) it will come back and say... hey, I'm done... and then you say "right, here is another 1024k... let me know when you're done", and so it continues, leaving the CPU to do more important stuff. :-)
December 10, 20187 yr 11 hours ago, plonkster said: From the PC up to the USB-serial chip it is faster. From there onwards it runs at normal serial speeds. Yes. Remember that commands and their responses all ultimately get to and from the inverter's Digital Signals Processor via a 2400 bps serial port. That's about 4 ms per byte, so a 100 character response takes some 400 ms (0.4 seconds) to shuffle out of the processor. From there it can get to the PC or Pi over serial or over USB, but it's still going to take nearly half a second to get that long response. With a little effort, it could have been so much better. Edited December 10, 20187 yr by Coulomb
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.