RPi Pico very slow communication with PC via serial #10217
Unanswered
justletmepickausername
asked this question in
RP2040 / Pico
Replies: 1 comment
-
So you are sending a message by USB to the Pico, which gets the data from I2C and returns it. According to the times you have seen these seem to depend on a timeout, probably in the USB-Serial interface. Can you show us how you set up and use that interface? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I've recently been given the task to create a USB/I2C converter to allow communication from a PC to some devices we have here at work.
This task was given as a response to the end of life announcement of a USB/I2C converter we had purchased and have been using in every project.
This old USB/I2C is at least 8 years of age, and of course, uses technology at least 8 years old, yet it produces MUCH faster speeds than the RPi Pico running MicroPython. (My assumption is that MicroPython is the culprit, but unsure about that)
It seems that the processing power of the RPi Pico is NOT the issue, rather the response time to commands via serial communication.
To explain further, let's pretend there's a function called "ReadI2C" which reads 1 byte from a fixed address, and another function called "Repeater" which has 10 calls to "ReadI2C" in a row.
Calling and running ReadI2C via an automated script takes on average 60ms from start to finish.
Calling Repeater which runs ReadI2C 10 times in a row, takes on average also 60ms from start to finish.
This tells me the "delay" is not coming from my source code itself, but from the MicroPython environment and the way it is set up.
Taking a step back for a second, I'd like to compare the old USB/I2C converter with the RPi Pico implementation of it.
The old one was much faster at around 10ms from start to finish on a single byte read request. So we're talking 6 times the speed.
Some relevant info:
In device manager I've set the baud-rate for the RPi Pico to 115200, so not the default 9600.
My automated script on the PC is not the issue, I've tested multiple different programming languages and I'm experiencing pretty much the same speeds.
Anyways, my question is whether or not this behavior is to be expected or not, and whether I may be doing something incorrectly?
Beta Was this translation helpful? Give feedback.
All reactions