Raspberry Pi Pico and Arduino Uno chat via I2C
Vložit
- čas přidán 6. 09. 2024
- Combining the best of Arduino and the Raspberry Pi Pico is easy via the Inter Integrated Circuit interface, better known as I2C. Looking to pick one over the other? why not both!
Pullup Resistor document: www.ti.com/lit...
As always, the code is available on my github page at github.com/tin...
An example with the Pico acting as an I2C slave would be interesting. There are already numerous examples of the Pico acting as master out there, but Pico as a slave is hard to find.
Hi! Do yo find something about a pico working as slave with I2C?
@@spontonluciano1668 No, unfortunately not. I stopped looking, to be honest, and kept using Arduino. Also, I switched from I2C to using serial via USB.
Excellent high-quality content and presentation. Deserves a much wider audience.
I, and many others, appreciate good work done well. This channel will prosper and deserves to do so.
Thank you Bob 🙂
This is an awesome video, will the same method work if i want to use a Raspberry pi 4 and the master and the Raspberry pi pico as slave?
Don't look for pull-up resistors. they are integrated into the logic level shifer.
People on the periphery feel offended now :( Otherwise, great video!
There is toCharArray() method in String() class.
But it is still unnecessary, as arduino's print() supports String() data type.
Could you run I2C over a pair of Cat6 conductors and if so, what length could you run it over?
That's a great question, I have no idea but it would be very interesting to try it. A quick Google suggests max length of between 1 and 10 meters so it seem quite variable
@@tinkertechtrove2910 Cat6 is quite good. It depends on the speed/frequency of the signals. You can adjust the speed yourself in your programming. I've managed over 300m so far. With speeds limited to 300K. Depending on the payload/application this can work fine. In my case... perfect.
Bandwidth being what it is means you can use ANY length or quality of wire you like given a slow enough speed. To achieve practical speeds however, that's a whole different question.
I was going to go through a while thing about i2c and different methods depending on topology to encapsulate the i2c data to go long distance... but... in the end it all boils down to, don't... you may find examples where people have got long distance communication working via i2c, however it's going to be highly dependent on the devices/transceivers, cabling, environmental noise, connectors, etc...
The better solution, in ye' olden days, pre-ethernet RS232 was used for networking (among other things) and there are libraries available that can do IP over RS232. RS232 is 'normal' serial. and that can be readily converted into RS485 which is a long distance, differential signal that is particularly suited to twisted pair conductors such as phone lines or Cat5/6 cable.
On the infrastricture side most microcontrollers have multiple RS232 interfaces so one device can forward on messages for the next one along, or you can make a simple hub, or a few as needed.
This would likely be the best method of connecting several distributed devices if wireless isn't wanted/available. in short... IP over RS232, with RS485 links over the longer hops.
If you can't use the IP over RS232 stuff due to ROM/RAM/load issues then you can write your own protocols, or possibly there are lighter weight comms protocols available... but the Pico should be able to handle it no problem. The uno will be the problem.
@@kal9001 This is a very good description of how/when/why. It all depends on the project/payload/protocol etc...
I'm very fond of RS232 and RS485, but you have to take in consideration what/how the connected device(s) support the technology. In some cases, you need to 'take care'... or do trouble shooting and come up with a solution within a certain budget and/or time window. We call it... 'arranging things'... Therefore, I'm an arrangeer instead of an ingeneer.... ;-)
in this case , resistance is not futile ;-) i think there are I2C repeaters or use a pico and its 2 I2C busses
please schema??????????????????????????????
7
How would the words slave and master in electronics be offensive!
You disappoint me! Disliked 😂😂😂😂