serial communication
P!-Ro
Posts: 1,189
I'm hoping to have serial communication occur between a prop and a pic, but I do not have any experience with it. Anybody wish to fill me in?
BTW--my intent is to transfer the numbers 1-20 (maybe more later) that would specify servo positions·controlling the·valve·on my gas engine. Then the pic could·then replicate it automatically without waisting a cog.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
BTW--my intent is to transfer the numbers 1-20 (maybe more later) that would specify servo positions·controlling the·valve·on my gas engine. Then the pic could·then replicate it automatically without waisting a cog.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
Comments
The PIC end is another thing entirely. It depends on the particular PIC you're using and whether it has a built-in hardware UART (Universal Asynchronous Receiver Transmitter) or whether the work has to be done in software. If you're using something like C or Basic for programming, the I/O library that comes with the compiler will probably have one or more serial input routines. You'll have to consult the manual for details.
The easiest thing to do is to run the PIC off the same supply voltage as the Propeller so all you need between the two is an optional 1K series resistor which protects the Propeller and PIC I/O pins from a programming error that makes both I/O pins outputs and of opposite polarity. It can happen.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
I think you'd be better off foregoing the second processor and simply doing it with the Propeller.
If you are going to go in-depth enough with a completely different architecture, perhaps you'd be better off going a bit deeper with the Propeller and re-writing some of your drivers to save a cog or two. I recently consolidated a few drivers into a single cog. I now have one assembly cog that performs duty as :
- RTC (with millisecond counter)
- 11 Channel 10-Bit A/D at 150K Samples/Sec (with 8 sample smoothing)
- 8 outputs on a 74HC595
And it's still idle most of the time and nearly half empty.
You can cram an awful lot of code into a single cog if you push it hard enough.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
digital compass
accelerometer
two servos with sonar modules on top
multiple ir object detectors--maybe about 20 or so to cover the front of my robot
GPS
radio transmitter/reciever
2 servos controlling my engine
motor for the brakes
motor for the steering
and in the far future a camera or two as well
Explain why I wish to use other micros as well?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
That's only 4 cogs and one of them is free much of the time. Even if you wanted multiple micros, the other ports of the serial I/O driver could handle that I/O (to talk to the other micro).
One other thing I didn't add to the top list is a program to measure engine rpm as well as actual wheel output. This way I can know true output speed as well as know how much slippage is occurring on the clutch. If there is too much, the robot may need to find a different way around to prevent it from burning up.
These are some other features things the robot will have:
Band protection:
It will use an IR detector on each side of the robot to detect IR signals from a band on the wrist of each person working around the robot. If the robot is in motion and can detect signals from one of these bands, it will automatically shut off the engine.
Emergency break activator:
If something occurs that cuts power or if there is another reason for lack of break usage, a signal possibly from another micro other than the prop will activate the breaks with a small battery pack separate from the rest of the electrical system.
Advanced people and animal detection:
I may use one or multiple IR heat sensors to detect people or animals in front of the robot.(sorry I didn't add this to the above list)
Operator input:
Above the control box there will be an LCD and possibly later a uOLED screen that will display run options, with a keypad allowing for input.
Warning lights:
If something should break down when the robot is in a dangerous area, such as on a road, many warning LEDs will flash informing other drivers of the robots presence.
Also, if I get it working with a camera, I intend to have it able to detect the difference between a rock, gravel, and paved road to change its speed and other actions accordingly, as well as be able to tell surfaces it can and can't drive on by color. I will also use it to attempt tasks such as possibly following a car using its color, and maybe also to try to find people with shirt color.
Some fun tasks in the future such as mounting a paintball gun and other fun things will also require it to predict paintball movements through the air and decide gun positions, as well as be able to know changing location of itself and it's target as it moves along.
For now one prop is fine, but I truly don't expect it to stay that way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG