Propeller Servo Controller
ajward
Posts: 1,130
Yup, me again...
Kinda related to my other question, I'm planning on driving those tower servos with a Basic Stamp through a Propeller Servo Controller. At first there will be 6 servos and if that works I might build up to 12. Just wondering if the BS2 will be up to the task?
The latest shiny thing will be (I hope) a bipedal 'bot. There are several kits available, but with a little scrounging and some parts already on hand, I can save several bucks.
Thanks!!!
Amanda
Kinda related to my other question, I'm planning on driving those tower servos with a Basic Stamp through a Propeller Servo Controller. At first there will be 6 servos and if that works I might build up to 12. Just wondering if the BS2 will be up to the task?
The latest shiny thing will be (I hope) a bipedal 'bot. There are several kits available, but with a little scrounging and some parts already on hand, I can save several bucks.
Thanks!!!
Amanda
Comments
You got me thinking... why not add some scratch pad memory to the PSC?
Attached is a new trial firmware version of the PSC that provides 256 Bytes of scratch pad memory to the the BS2
!SCMR{Address,[Value]} - Read Memory at Address : Address Range 0-255
!SCMW{Address,Value} - Write Memory to Address : Address Range 0-255
!SCMG{Address,Size,[N1..Nsize]} - Get Block of Memory starting at Address and Size : Address Range 0-255
!SCMP{Address,Size,N1..Nsize} - Put Block of Memory starting at Address and Size : Address Range 0-255
Note: Square brackets indicate a returned value
Note: with Put and Get functions, memory addressing will wrap around, meaning if you specify a starting address of 250 and request a Size of 10, then the
address bytes written or returned will be from locations .... 250,251,252,253,254,255,0,1,2,3
BS2 hexapod video:
http://youtu.be/V3KSQxtWOYQ
-Phil
Thanks Martin!
Appreciate the information. Not sure I'll be worrying about sensors for some time. When I get six servos working together, I'll be ecstatic!
I should clarify... my uC board is a Stamp BOE with a BS2P... a bit more ram and a bit more speed. (More speed is always better... 'cept when CHP is nearby!)
Amanda
Gordon... Not sure reprogramming the PSC is something I'm up to. I'm "kind of" comfortable with Spin, but a lot of things I see y'all accomplish with it rank right up there with magic!
Phil... I wasn't aware you could do that. More things to research. Thank You! :-)
Amanda
For a Propeller it's much easier than it might appear. You basically run your additional code in a separate cog. For the PSC, you have six (I think) cogs free, as the code only uses two. Each cog does its thang separately.
For a board like the PSC the limiting factor is the number of I/O pins. If you do expand to 12 servos, that leaves only four pins free. But those four could be applied to lots of different things. For example, you could play sound effects through a cog and a free pin. Or you could add remote control on one of the pins. Have a cog run some Sony SIRC code (see the Obex), and if it detects a valid button press from a remote, it can communicate that back to your BS2.
Yes, you can put everything in the PSC, but then you'd lose any code you've already developed for your robot in PBASIC.
Beau, this is a really good idea. I eventually made the jump from the BS2 to the Propeller, but for people who really prefer the BS2, this could help them do more sophisticated projects.
Thanks Martin ... I need a couple of testers to make sure the code addition functions properly as described. I didn't have an actual PSC to test with so I was only able to test the code snip in isolation. If all is well we will incorporate that into future PSC's. Note: the !SCVER?<CR> command has been incremented also.
I updated the firmware in both my controllers and would be happy to test the new code... I just need to figure out how to implement the new features.
@
Exactly. The bi-directional buffers on the PSC allow pins not driving servos to be used as outputs.
Amanda
One day I'll use it and everything else in my "to try" box...
Speaking of which, those Black Friday sales are coming up this month...
I found a PSC over the weekend I didn't know I had, and was able to Test the code. I also found a few things that I had updated that didn't make it's way into the distributed firmware. (<- We will be making that correction shortly) .... here is basically the history update for the Firmware:
PSC Firmware Update History:
Below is the latest PSC firmware (tested) and example Basic Stamp II code to communicate with the new scratchpad features
Basic Stamp II Code example:
I installed the firmware on both PSC units and ran the example code. Everything seems to work okay. I changed the code (and values) just a bit to indicate what values were being sent to scratchpad ram.
Screenshot of debug output:
Very nice. With a hairy spider style cover over the top it would make quite the Halloween decoration.
That's way cool vanmunch . I ran across an six-legger kit using 18 micro servos. I have most of the servos, but that's a little more than I want to tackle right now. Perhaps down the road a ways. :-)
@
When I installed the firmware update to the PSC's, I kind of assumed the code went into a special area kind of like a peecee bios. However from all I can see the update went into the EEPROM just like any other program. Is that the way it works? If I want to run some Prop code in the PSC, I have to load it along with the firmware code? Seems odd, but I guess I can work around that.
Amanda
-Phil