I/O pins question
skatj
Posts: 88
I feel really dumb asking this, but what is the difference between the serial I/O in the servo ports and the I/O pins lining the breadboard on the BOE?
I ask this because I am using both servo port 15's I/O line to read a square wave value from an r/c receiver, as well as I/O pin 15 to interface my floating point coprocessor.
Somehow, the stamp can tell the difference when I specify "15" as the pin number in the PULSIN command.
However I will be using I/O pins for the other channels on my receiver, so I was wondering if anybody could tell me the difference?
I ask this because I am using both servo port 15's I/O line to read a square wave value from an r/c receiver, as well as I/O pin 15 to interface my floating point coprocessor.
Somehow, the stamp can tell the difference when I specify "15" as the pin number in the PULSIN command.
However I will be using I/O pins for the other channels on my receiver, so I was wondering if anybody could tell me the difference?
Comments
I don't have a BOE handy, but I suspect I know the answer to your question. In one case you are using Pin Port 15 as an Input, and in the other case you are using it as an Output.
The Stamp doesn't have to "know" anything about the pin itself, or where it's located. It only cares that you have specified a Pin Port (whichever one you choose) and uses that one as you have specified. I hope that makes sense to you.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Genius is one percent inspiration and ninety-nine percent perspiration."
Thomas Alva Edison
I haven't defined my FPU pins either, although I have them physically connected to pin 15 on the breadboard.
When I integrate this code into my main program, will there be conflicts? (the "other", non-port pin 15 is both an I and an O I believe)
What you may mean to be saying is that you haven't EXPLICITLY defined any pin or port as Input or Output. That is quite true. However, the PULSIN command does that for you. Here is an excerpt from the PBASIC Help File in reference to the specified PULSIN pin port:
"Pin is a variable/constant/expression (0 - 15) that specifies the I/O pin to use. This pin will be set to input mode."
As you can see, PBASIC will set the specified pin port to Input (or Output, as the case may be) for you. The PBASIC documentation will tell you when it does this for you, and when it must be done by you.
We·can't predict whether you will have any future pin port conflicts until·we see the rest of·your program. If you follow what was said above, you shouldn't expect any problems.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Genius is one percent inspiration and ninety-nine percent perspiration."
Thomas Alva Edison
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support