Question about multiple copies of MultiPWM 74HC595 object and stack space
RobotWorkshop
Posts: 2,307
I have a couple sets of 74HC595 chips (two sets of four) connected to the Propeller for LED lighting/effects on my project. I'd like to use the MultiPWM 74HC595 object here to control them:
http://obex.parallax.com/objects/437/
I was able to test out the hardware on the bench using one instance of the object and it seems to work well. Now I'd like to use two instances of it in my program. There are a couple of questions I have about this.
For the start method in the code I don't see where it is allocating any stack space. Is this something that I need to do for each one or should it be ok as it is and let the object handle it.
Is there going to be any issues with using the object twice in a project? I seem to recall reading that some objects may need to be edited and altered in order to use it more than once.
http://obex.parallax.com/objects/437/
I was able to test out the hardware on the bench using one instance of the object and it seems to work well. Now I'd like to use two instances of it in my program. There are a couple of questions I have about this.
For the start method in the code I don't see where it is allocating any stack space. Is this something that I need to do for each one or should it be ok as it is and let the object handle it.
Is there going to be any issues with using the object twice in a project? I seem to recall reading that some objects may need to be edited and altered in order to use it more than once.
Comments
Is anyone using the MultiPWM 74HC595 object above and if so have you tried using more than one at a time?
You only need to worry about stack space when a Spin interpreter is launched to a new cog. PASM drivers don't need additional stack space.
If you can tolerate a slower PWM frequency the driver could be modified to control more than 4 chips.
Edit: I was just looking at the object to see how to change it to use more than 4 chips. While the change could be done, it wouldn't be simple. There are too many advantages to using the 32 bits in a long to store the state of the 32 pins of the four chips. It's not a simple matter of changing a few constants.
Edit again: I found the program where I use multiple instances of MultiPWM object. I used three instances in the program. As I mentioned earlier, stack space wasn't a issue.
Thanks for your response! The propeller is connected to two separate remote daughter boards which each contain four 74HC595 chips. Running two instances of the object would work best so it looks like things will be ok. I should be able to do some testing this evening.
Robert
http://www.youtube.com/watch?v=pDgvKn_u6Fk
Robert
Do you have details about this robot posted somewhere?
What are you using for speech? Is it a text to speech board/chip or wav files.
What about the speech recognition? What are you using.
Do you have PC incorporated with the robot or some other brain?
Again, this is so cool. Thanks for posting the video.
Thanks for the kind comments! It has been a lot of work getting this far but I am really happy with the progress so far. I am writing up the whole project now and hope to have the rest of the robot finished and mobile by the time I finish writing the last part. I'm trying to get most of it functioning for a demo in a couple weeks for a cub scout pack meeting.
One of the processors onboard is a Propeller that is handling all the lighting on the robot (there is a video of the back panel on my thread on the MAX7219), some other I/O, head control, and extra sensors. The main brain on this is running a laptop with software from the open source LEAF project. Speech recognition is the built-in Microsoft Speech. It ha s custom voice with some tweaking. I've had parts around for years and finally pulled it all together. There is a lot of customizations, custom parts, and all the wiring in the robot is from scratch. The code to share famous quotes I made yesterday and it has a couple hundred phrases in there now.
The Propeller protoboard and one of the daughter boards for the LED's like this:
I still need to add connector for a few limit switches and an encoder for the head to keep track of where it is. Once those are on I will finish the code for the head control.
My website is long, long overdue for an overhaul and a lot of this will be posted there as well as other projects and past articles that I wrote for SERVO, Nuts'N'Volts, and MAKE.
Robert