i2c prop to prop
micronewb
Posts: 20
Hey everybody,
Has anybody managed to use an I2C bus in a multi master setup to communicate between propellers. So far I am starting, stopping, and writing correctly, but when I read on the slave propeller I am having clock syncing issues and it is missing pulses. I am working on a project where I need multiple propellers to communicate in both directions. Any ideas, i'm also open to other ways of accomplishing this (the faster the coms the better)? Thanks for the help.
Has anybody managed to use an I2C bus in a multi master setup to communicate between propellers. So far I am starting, stopping, and writing correctly, but when I read on the slave propeller I am having clock syncing issues and it is missing pulses. I am working on a project where I need multiple propellers to communicate in both directions. Any ideas, i'm also open to other ways of accomplishing this (the faster the coms the better)? Thanks for the help.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
For instance:
obex.parallax.com/objects/546/
Massimo
you wouldn't have to worry about formatting packets and all the overhead. We have seen
well over 500 Kbsec with the Propeller running at 100 MHz.
Russ
propeller could talk to any other and you wouldn't need a master.
You would have to write a simple OS to control the bus, check parity and detect
collisions.
Russ
Point to point serial connections > 19.2Kb/s require a COG per connection.
No problem if you only need one connection or two like BigFoot's ring idea.
Unfortunately, the Propeller I2C device code I've seen is quite slow.
http://forums.parallax.com/showthread.php?p=721563
An 8-bit bus protocol with pseudo-dma would allow up to 255 devices
and 5 MB/s data transfer rates in one COG per device (I did this in single
master mode only). Here is a link to my parallel bus effort:
http://forums.parallax.com/showthread.php?p=839672
With a transport layer done, then you have to focus on a fit IPC method
which can be simple or a big can of worms depending on the application [noparse]:)[/noparse]
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
The other option is to use a serial ring, tx· goes to the next prop, rx goes to the previous prop. You will need some work to do addressing, remove stuff from the ring etc.
Both need 2 pins and a cog but the serial ring is propably easier since the serial driver will do the low level work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
Steve I expect one could get a single cog to run three or four simultaneous half duplex ASCII channels at 115,200, reading from and dumping to hubram.
Cheers,
Peter (pjv)
Hi Peter, yes it is possible using your scheduler.
A little Spin packaging would make your method more accessible to the average user.
Maybe use a startup interface something like this:
It might be worth starting a topic dedicated to using the scheduler.
We could all help each other develop scheduler interface routines there.
A good first example would be how to add serial interfaces.
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
I'd love to see a one cog driver that combined keyboard, mouse, and one or two serial ports!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
Las - Large model assembler Largos - upcoming nano operating system
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
(geek humor escalation => "There are 100 types of people: those who understand binary, and those who understand bit masks")
That sounds like a good idea, and I can contribute to that, but perhaps not for a bit yet.
Actually I'm working on a scheme just now where the tiny drivers I use are stored in HubRam, and get pulled into CogRam as required. The scheduler of course lets me do this in the background. So as the mainline executes, it will cause the necessary tinies to be loaded, used and discarded as required, and genreally runs at full speed. This way CogRam appears to much larger than it is, because it gets reused. I think one could effectively get rather large programs to run in this manner in a single Cog because only that which is required stays resident, the rest gets swapped out.
Perhaps this is how your LMM works.... I have not yet looked at that since I'm having too much fun trying these concepts.
Cheers,
Peter (pjv)
i'm cool with ideas of things people haven't tried but think would work. I am going to have to write something new either way I would rather start with the best overall method first and write one rather than several to find the best if possible. i'll check into the CAN bus.... thanks
Not quite how it works (well, unless you use FCACHE), but very close.
Actually I am considering brushing off an old idea - writing a multi-threaded LMM kernel. I think I mentioned that possibility in my original LMM thread. It would be pretty easy to make one that was quite deterministic for four threads, giving four 1MIPS threads. Or nine 0.5MIPS threads.
Hmm... I should do that. It would make writing the combo driver I really want (kb/mouse/2 serial) fairly trivial!
I think I will call it TLMM for Threaded Large Memory Model
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
Las - Large model assembler Largos - upcoming nano operating system
Propeller (Data in & Data out). The data would have to travel through four of
the five processor maximum.
I made a typo in one of the posts above, we think we can get over 400 Kbaud
with the propeller running at 100 MHz. Even our 80 MHz terminals run reliably
at 115 Kbaud.
Russ
One way to solve this would be to implement a token ring or star configuration where in the token ring only one master was allowed to talk at a time in a round-robin fashion. The same goes with a star configuration, only one master allowed to talk at a time, but with the star configuration each master has an ID and is only allowed to 'talk' if given permission from the previous master (<-- could be in any order).
Having a single master at any given time allows the signal to be driven high rather than pulled high.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.