Technical resources for Scribbler 2
I'm new to the forum (as you can no doubt tell) so hello everyone. I'll start by apologising in case this is one of those questions that has been asked innumerable times but I have spent a fair bit of time searching the forums and the Parallax website and no joy so far. Probably the answer is right under my nose but if so I guess I need someone to push my nose out of the way for me!
Okay, so here is the story. Twenty years ago I did my degree in microelectronics which involved programming microprocessors and microcontrollers to operate robotic systems. We started off programming at low level and worked our way up to languages like C. After leaving university I got interested in C++ and programmed in it as a hobby for quite a few years before other interests pulled me away. Three years ago I bought a Scribbler S2 hoping to interest my son in robotics and programming, but it never really took off so the robot was carefully packaged up and forgotten about.
Now I don't know if it's mid-life crisis or whatever but suddenly I find I want to rediscover my old skills and I have set myself the project of creating (from scratch) a C++ class capable of controlling the S2. It's possible that there is already one out there (although in my research I didn't find one, just the Mypro-C++ one which is for the Scribbler S1 with something called a Fluke attached and so not exactly the same) but anyway the whole point is to create my own as a project. I should also point out that I will be using SimpleIDE on a Mac so even if I wanted to use it the GUI is of no use to me.
What I am currently struggling with is the technical details of how the Propellor interacts with the various resources on the S2. I can write code to the Propellor no problem, and I have a schematic showing which I/O pins are connected to what, but I cannot work out how to control or get data from any of the devices. So what I am looking for is a resource that explains how to directly control the various devices on the S2. It doesn't need to be language specific, I'm interested in the mechanism of how the Propellor controls these devices - I can work out from there how to deliver that in C/C++.
Hopefully there is something somewhere that provides this information. So I would be very grateful if someone could point me in the right direction.
Okay, so here is the story. Twenty years ago I did my degree in microelectronics which involved programming microprocessors and microcontrollers to operate robotic systems. We started off programming at low level and worked our way up to languages like C. After leaving university I got interested in C++ and programmed in it as a hobby for quite a few years before other interests pulled me away. Three years ago I bought a Scribbler S2 hoping to interest my son in robotics and programming, but it never really took off so the robot was carefully packaged up and forgotten about.
Now I don't know if it's mid-life crisis or whatever but suddenly I find I want to rediscover my old skills and I have set myself the project of creating (from scratch) a C++ class capable of controlling the S2. It's possible that there is already one out there (although in my research I didn't find one, just the Mypro-C++ one which is for the Scribbler S1 with something called a Fluke attached and so not exactly the same) but anyway the whole point is to create my own as a project. I should also point out that I will be using SimpleIDE on a Mac so even if I wanted to use it the GUI is of no use to me.
What I am currently struggling with is the technical details of how the Propellor interacts with the various resources on the S2. I can write code to the Propellor no problem, and I have a schematic showing which I/O pins are connected to what, but I cannot work out how to control or get data from any of the devices. So what I am looking for is a resource that explains how to directly control the various devices on the S2. It doesn't need to be language specific, I'm interested in the mechanism of how the Propellor controls these devices - I can work out from there how to deliver that in C/C++.
Hopefully there is something somewhere that provides this information. So I would be very grateful if someone could point me in the right direction.
Comments
I think you are trying to say, You are a software guy, and not a hardware guy?
The Scribbler 2 is an awesome machine, I have a great time with mine, Don't be afraid to void the warranty,
Check out what fellow forum member Gareth is doing to his S2...:thumb:
-Tommy
In truth I could build my own equivalent of the S2 - as I mentioned my background is in microelectronics so it should not be beyond me (not that it would be anywhere near as good of course). But if I did that then I would know how it was built and how to address the various components whereas with the Scribbler I don't have that information. Looking at the schematic there appear to be multiplexers, wheel drive controllers, etc in there and without a guide of how I get the Propeller to talk to them I can't get any life out of the machine.
You are not wrong however in the sense that right now I want to first focus on the software side - and the S2 should be an ideal platform for that if I can just work out how to talk to it. Once I feel that I am on top of that once more my plan is to progress on to the hardware side of things - for example one of my plans is to build a Propellor-based AUV to explore the various canals we have near where I live.
I will take a look at what Gareth is doing, thanks - but at this point mostly I need help with how to talk to the S2. To be honest I have been a bit surprised that there is not more information available online on how the S2 works, and given what people are doing with it on this forum the information must exist somewhere.
If you download the S2 GUI and install it, there is a S2.SPIN file that get set up. This is the code that has all the routines that interface to the S2 hardware. If it is a part of the S2, there is a routine in S2.SPIN that talks to it.
With this code and the S2 schematic (available on the S2 page) you pretty much know where all the hardware is attached and have some example code (very good code) of how to talk to the component.
It sounds like you have the background in HW and SW to work with this information and generate the C/C++ code you need.
It is the brains of the operation, and is what communicates with the sensors and wheels of the S2...:)
-Tommy
Took the lid off the 'bot earlier today and with the help of a magnifying glass found the ID number of the MUX chips and hence downloaded the relevant data sheet - so if necessary that's the fallback plan for working out how to deal with the sensors.
I attached the the Help Folder (zipped).
If you open "english_help.html" and go to the bottom left, and click on "S2 Spin Object Documentation", all the methods are broken down for each section. (click "Source Code" in each section to expand)
Jim
I'm struggling a bit with the spin though, probably just inexperience with the language. From what I can see the method run_motors is the 'lowest level' method for controlling the motors but try as I might I cannot work out from the source code what it actually tells the Propellor to do. Sorry if this is really simple and I am missing something but as far as I can tell the code below contains only variables and no actual command!
If someone can explain to me where in that is the actual command that tells the Propellor how to drive the motors it would help me make sense of it.