Wulffy
09-11-2007, 12:17 PM
To·save myself a bunch of retyping, I have included a post made to a different forum (http://www.rcgroups.com/forums/showthread.php?t=740494).
I decided to post herein to solicit the feedback of those intimately familiar with the Propeller device to see if it could indeed be a viable solution for an Multi-Master SPI Bus Arbitrator for a system topology that will have several 'Masters' and several 'Slaves'.· In reading the following, I am sure that you will be able to glean that I am looking at having several MCU units as my 'Masters' - they are ARM based SBCs and Stamps.· The slave devices will be items such as MicroMegaCorp's uM-FPU (http://www.micromegacorp.com/), GHI Electronics' uAL-FAT SD (http://www.ghielectronics.com/details.php?id=1&sid=2), and a blazing-fast, zero-wait, near-unlimited write FRAM memory device (http://www.ramtron.com/doc/Products/Nonvolatile/Nonvolatile.asp?ID=5).
During the course of my dialogue with several veterans in the business, the prop came up as a possible viable-candidate for selection as a MM-SPI Bus Arbitrator.· Being totally ignorant with respect to the device, it's strength and weakness', and it's real eligibility for consideration in this role,·I'm requesting objective feedback from·you kind folks, as to if you feel the Propeller would accel in this capacity.
My target topology is currently a 3 Master, 3+slave SPI bus arbitrated by either code and hardware onboard the masters, or if that is not feasible, the use of a dedicated SPI communications arbitrator with a device such as the Propeller.
Please review and advise.· Thanks in advance.· Have a wonderful day!· -t
------------------------------------------------------------------------------
I am sure that this thread will prove to be a bit esoteric, but I am struggling with something that I'd like to throw out to the group for review and consideration.
My issue is this: I am looking at implementing common-memory on a Multi-Master SPI bus. I am looking at having three masters. I'd like to provision for a total of four (a minimum) or more, to facilitate future growth.
I have read a lot and understand that, in it's native implementation and by it's very nature, SPI and a Multi-Mater topology is somewhat mutually exclusive.
I plan on having 3+ SBCs in my system. Without having the luxury of interrupt driven events, no RTOS capabilities, and a strong need to facilitate High-Speed Asynchronous Transfer of data to and from one module to the other, I have decided to try and tackle what some texts have described as "rare and awkward, and are usually limited to a single slave (http://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Disadvantages)".
One oh the hardware-layer elements·that I am looking at using to effect this is SPI-Based FRAM. The primary reasons for this choice is three-fold:
Longevity. First and foremost, due to the very high quantity of read/writes that I am looking at, having 10^12 to "unlimited" write cycles will serve to ensure that once deployed, I won't run into issues with reliability that Flash based devices would be faced with, possibly failing after as few as 10^5 or 10^6 write cycles. Zero-Wait state. The data is stored as fast as I can possibly shovel it down the device's throat, without having to stall while waiting for the memory device to retain the data - no refreshes, no battery backup, no delays related to writing to slow flash. Speed. I2C, by design, facilitates multiple masters, but I2C is slow. SPI, conversely, is darn quick, and I feel is the better choice given what I want to use this for, especially with the Speed of SPI coupled with the Zero-Wait memory - should prove to be brutally fast, if it can be made to work...
Accordingly, I have decided that I want to jump this high hurdle...
I am going to have one of my MCUs acting as a Telemetry Host - interfaced to a MaxStream Xtend transceiver. It will be responsible for querying the common-memory to retrieve the parameters that are to be transmitted. Additionally, it will also receive commands from the ground control station for the airborne subsystems and store them in the common-memory. The Telemetry Host MCU could also be the Flight Data Recorder, if I determine that it has enough 'idle' time when I do my work-load studies on the ship's systems.
I will have a 2nd MCU acting as a Navigation Computer Unit (NCU). By virtue of it's name, I am sure that you can probably extrapolate it's role in life - GPS/IMU interface-based 3D-Waypoint navigation.
I initially planned on also have a third MCU acting a flight data recorder and also as a movable surfaces controller, listening to the Rx's ppm and demuxing it to the servos/actuators, and I may very well proceed in this fashion. The one thing that may cause me to reconsider this is the fact that there are some pretty simple and robust COTS solutions showing up out there with PIC-based dedicated servo controllers, or the new ASIS? that MX has a lead on (I haven't yet ping'd MX for the vitals on that - I'll let him get comfortable with the hardware first, before I go bugging him about it...). If these COTS solutions prove to be sufficient and reliable enough, then I won't re-invent the wheel and I'll try to push the flight data recording back onto the Telemetry Host MCU, and implement the COTS solution for Servo Demuxing, Control, and Failsafe. This is all going to be driven by the loop iteration rates that I can get out of each of the subsystems...
That bring me full circle to the root-reason for the implementation of the common-memory device. My hardware choice and language selection doesn't yield a combination where I feel that I will have the resources to have coordinated synchronous communication directly between the various subsystems without substantive overhead penalties. I feel that this overhead would be unacceptable.
Being able to have each subsystem having a control loop that is NOT predicated on relying on a separate subsystem's commands or data communications will yield the most efficient and desirable results - i.e. I feel that:
Having the NCU collecting data from the GPS/IMU, doing the 3D or 4D navigation calculations, storing the needed reactions to the high-speed common-memory and moving on to do it all over again will serve to yield a very high loop rate for this subsystem Having the Telemetry Host being able to go to the high-speed common-memory to immediately store any received commands, and then retrieve the various parameters that require transmission, without having to wait for other systems to get to the point in their loop to directly provide the data to it, will serve to ensure that the the control loop for the Telemetry Host is at an adequately high enough rate. Having the Movable Surfaces controller being able to fetch the required corrections, independent of the source of said corrections, will surely serve to ensure that the control loop iteration rate is sufficiently high.
Basically the above serves to illustrate that the operations of the various subsystem's loops can become pseudo-autonomous and independent of the other subsystems, with the storage/extraction of commands and information to/from the FRAM SPI slave device.
...
Utopia would be the availability of a SoC device that has three or four+ SPI·master-input ports with multi-port FRAM, and a slave SPI bus. ·Again, I have searched and have yet to find such a device... Granted I could implement something with FPGA systems, but that has a whole set of penalties that I don't think I am willing to pay.
With the zero-latency of FRAM, with the high speed of SPI, and with the inter-subsystem independence that this approach provides, I feel that this is a very compelling reason to try to implement what I am considering.
...
So, now that I have over-bloodied the frigging horse :), can those of you who may have some first-hand knowledge of Multi-Master SPI (MM-SPI/SPI-MM) arbitration implementation please reply with some suggestions as to how the successful arbitration of 3+ masters with single/ multiple slave devices might be able to be achieved?
Some have mentioned that a Parallax Propeller might be the way to go with the processor array that it possess', other have suggested FPGAs with embedded processor cores and memory. I'd like to think that there might be a way to successfully implement this without having to rely on any additional external components. SPI bus collisions need to be totally avoided. Unrecoverable system crashes are not acceptable. it seems to me, ignorance admitted, that the use of one or more GPIO lines in between the Masters, and some simple check and balance code on each Master, should be a means with which to successfully implement said arbitration with a very high degree of reliability and a (very-?)small performance penality...
Thanks for reading my diatribe. Please review and advise with any viable suggestions that you might have, or have experienced success with previously.
Again, thank you!
-t
p.s. In addition to the SPI FRAM device, I also have an I2C FRAM device coming, just in case I can not make the MM-SPI implementation work as needed/intended...
I decided to post herein to solicit the feedback of those intimately familiar with the Propeller device to see if it could indeed be a viable solution for an Multi-Master SPI Bus Arbitrator for a system topology that will have several 'Masters' and several 'Slaves'.· In reading the following, I am sure that you will be able to glean that I am looking at having several MCU units as my 'Masters' - they are ARM based SBCs and Stamps.· The slave devices will be items such as MicroMegaCorp's uM-FPU (http://www.micromegacorp.com/), GHI Electronics' uAL-FAT SD (http://www.ghielectronics.com/details.php?id=1&sid=2), and a blazing-fast, zero-wait, near-unlimited write FRAM memory device (http://www.ramtron.com/doc/Products/Nonvolatile/Nonvolatile.asp?ID=5).
During the course of my dialogue with several veterans in the business, the prop came up as a possible viable-candidate for selection as a MM-SPI Bus Arbitrator.· Being totally ignorant with respect to the device, it's strength and weakness', and it's real eligibility for consideration in this role,·I'm requesting objective feedback from·you kind folks, as to if you feel the Propeller would accel in this capacity.
My target topology is currently a 3 Master, 3+slave SPI bus arbitrated by either code and hardware onboard the masters, or if that is not feasible, the use of a dedicated SPI communications arbitrator with a device such as the Propeller.
Please review and advise.· Thanks in advance.· Have a wonderful day!· -t
------------------------------------------------------------------------------
I am sure that this thread will prove to be a bit esoteric, but I am struggling with something that I'd like to throw out to the group for review and consideration.
My issue is this: I am looking at implementing common-memory on a Multi-Master SPI bus. I am looking at having three masters. I'd like to provision for a total of four (a minimum) or more, to facilitate future growth.
I have read a lot and understand that, in it's native implementation and by it's very nature, SPI and a Multi-Mater topology is somewhat mutually exclusive.
I plan on having 3+ SBCs in my system. Without having the luxury of interrupt driven events, no RTOS capabilities, and a strong need to facilitate High-Speed Asynchronous Transfer of data to and from one module to the other, I have decided to try and tackle what some texts have described as "rare and awkward, and are usually limited to a single slave (http://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Disadvantages)".
One oh the hardware-layer elements·that I am looking at using to effect this is SPI-Based FRAM. The primary reasons for this choice is three-fold:
Longevity. First and foremost, due to the very high quantity of read/writes that I am looking at, having 10^12 to "unlimited" write cycles will serve to ensure that once deployed, I won't run into issues with reliability that Flash based devices would be faced with, possibly failing after as few as 10^5 or 10^6 write cycles. Zero-Wait state. The data is stored as fast as I can possibly shovel it down the device's throat, without having to stall while waiting for the memory device to retain the data - no refreshes, no battery backup, no delays related to writing to slow flash. Speed. I2C, by design, facilitates multiple masters, but I2C is slow. SPI, conversely, is darn quick, and I feel is the better choice given what I want to use this for, especially with the Speed of SPI coupled with the Zero-Wait memory - should prove to be brutally fast, if it can be made to work...
Accordingly, I have decided that I want to jump this high hurdle...
I am going to have one of my MCUs acting as a Telemetry Host - interfaced to a MaxStream Xtend transceiver. It will be responsible for querying the common-memory to retrieve the parameters that are to be transmitted. Additionally, it will also receive commands from the ground control station for the airborne subsystems and store them in the common-memory. The Telemetry Host MCU could also be the Flight Data Recorder, if I determine that it has enough 'idle' time when I do my work-load studies on the ship's systems.
I will have a 2nd MCU acting as a Navigation Computer Unit (NCU). By virtue of it's name, I am sure that you can probably extrapolate it's role in life - GPS/IMU interface-based 3D-Waypoint navigation.
I initially planned on also have a third MCU acting a flight data recorder and also as a movable surfaces controller, listening to the Rx's ppm and demuxing it to the servos/actuators, and I may very well proceed in this fashion. The one thing that may cause me to reconsider this is the fact that there are some pretty simple and robust COTS solutions showing up out there with PIC-based dedicated servo controllers, or the new ASIS? that MX has a lead on (I haven't yet ping'd MX for the vitals on that - I'll let him get comfortable with the hardware first, before I go bugging him about it...). If these COTS solutions prove to be sufficient and reliable enough, then I won't re-invent the wheel and I'll try to push the flight data recording back onto the Telemetry Host MCU, and implement the COTS solution for Servo Demuxing, Control, and Failsafe. This is all going to be driven by the loop iteration rates that I can get out of each of the subsystems...
That bring me full circle to the root-reason for the implementation of the common-memory device. My hardware choice and language selection doesn't yield a combination where I feel that I will have the resources to have coordinated synchronous communication directly between the various subsystems without substantive overhead penalties. I feel that this overhead would be unacceptable.
Being able to have each subsystem having a control loop that is NOT predicated on relying on a separate subsystem's commands or data communications will yield the most efficient and desirable results - i.e. I feel that:
Having the NCU collecting data from the GPS/IMU, doing the 3D or 4D navigation calculations, storing the needed reactions to the high-speed common-memory and moving on to do it all over again will serve to yield a very high loop rate for this subsystem Having the Telemetry Host being able to go to the high-speed common-memory to immediately store any received commands, and then retrieve the various parameters that require transmission, without having to wait for other systems to get to the point in their loop to directly provide the data to it, will serve to ensure that the the control loop for the Telemetry Host is at an adequately high enough rate. Having the Movable Surfaces controller being able to fetch the required corrections, independent of the source of said corrections, will surely serve to ensure that the control loop iteration rate is sufficiently high.
Basically the above serves to illustrate that the operations of the various subsystem's loops can become pseudo-autonomous and independent of the other subsystems, with the storage/extraction of commands and information to/from the FRAM SPI slave device.
...
Utopia would be the availability of a SoC device that has three or four+ SPI·master-input ports with multi-port FRAM, and a slave SPI bus. ·Again, I have searched and have yet to find such a device... Granted I could implement something with FPGA systems, but that has a whole set of penalties that I don't think I am willing to pay.
With the zero-latency of FRAM, with the high speed of SPI, and with the inter-subsystem independence that this approach provides, I feel that this is a very compelling reason to try to implement what I am considering.
...
So, now that I have over-bloodied the frigging horse :), can those of you who may have some first-hand knowledge of Multi-Master SPI (MM-SPI/SPI-MM) arbitration implementation please reply with some suggestions as to how the successful arbitration of 3+ masters with single/ multiple slave devices might be able to be achieved?
Some have mentioned that a Parallax Propeller might be the way to go with the processor array that it possess', other have suggested FPGAs with embedded processor cores and memory. I'd like to think that there might be a way to successfully implement this without having to rely on any additional external components. SPI bus collisions need to be totally avoided. Unrecoverable system crashes are not acceptable. it seems to me, ignorance admitted, that the use of one or more GPIO lines in between the Masters, and some simple check and balance code on each Master, should be a means with which to successfully implement said arbitration with a very high degree of reliability and a (very-?)small performance penality...
Thanks for reading my diatribe. Please review and advise with any viable suggestions that you might have, or have experienced success with previously.
Again, thank you!
-t
p.s. In addition to the SPI FRAM device, I also have an I2C FRAM device coming, just in case I can not make the MM-SPI implementation work as needed/intended...