smart pin question - serial
msrobots
Posts: 3,709
in Propeller 2
I am able to use serial fullduplex with smart pin use.
But I need to do something I think should be possible I just do not really understand the documentation.
I do have one COG running using 2 smart pins for fullduplex serial. And I need another COG running fullduplex serial talking to the first one.
The simple solution is to use 2 other smartpins and connect tx/rx and vice versa with some secure resistor.
But do I need to? Shouldn't I be able to take the pins next to them and access them internal?
I feel quite helpless on what to change to use not the pin itself but its neighbor so I can run txMode on say pin 51 in one COG and rxMode on pin 52 in another but using pin 51 as input.
Help!
Mike
But I need to do something I think should be possible I just do not really understand the documentation.
I do have one COG running using 2 smart pins for fullduplex serial. And I need another COG running fullduplex serial talking to the first one.
The simple solution is to use 2 other smartpins and connect tx/rx and vice versa with some secure resistor.
But do I need to? Shouldn't I be able to take the pins next to them and access them internal?
I feel quite helpless on what to change to use not the pin itself but its neighbor so I can run txMode on say pin 51 in one COG and rxMode on pin 52 in another but using pin 51 as input.
Help!
Mike
Comments
btw, this is super easy to test in TAQOZ.
something like this This should read the data from rx_pin-1
That is a little hard to understand what you are wanting! The answer is that the maximum pin-range that a smartpin can "see" is +-3 pins.
So, it is possible to setup another pair of rx/tx pins, as close neighbours, without requiring physically looping between them outside the chip.
Yes I do understand that. so I want to use the pin next to it from the other COG, but using the other pin as input, as far as I understand smartpins can use other pins in range of +-2(3?)
I just don't understand how to set this up
this works fine and I can use 4 pins to communicate, no problem. But I need to wire a bridge between two pairs.
if my txpin- smartpin could use the pin next to it (txpin+1) I would not need to wire anything, even if still using 4 pins.
question better explained?
Mike
thanks @ozpropdev and @evanh
so
Am I getting this right?
Mike
hmm, not really clear.
when I want to use my pin as a input 000 gives me my own pin, 0001 gives me my pin+1
when I want to use my pin as a output 000 gives me my own pin, 0111 gives me my pin-1
and I just need the A selector, right?
so COG A does
and COG B does
getting better?
Mike
I would keep them as typical pairs: 50/51 for one pair and 52/53 for the other. The key is to simply map the two rx smartpins to receive from the other cog's tx pin. Eg:
this sort of confuses me right now, and I shortly am close to hijack TAQOZ and MONITOR from fastspin, it works quite well already but not as I need it.
Currently I have a PropPlug on the header left next to the usb PC and can compile a fastspin program, open the PASM2 add a starter and change orgh to $10800.
The starter starts the original fastspin code at $10000 in COG1, leaving the first 64K for TAQOZ and monitor, patches the ROM to use other pins for serial and jumps COG0 into TAQOZ.
That works, my program runs, can use the serial port, humms along and does not know that I have TAQOZ running in COG0 connected to a terminal, able to watch my program.
But I would like to use the running TAQOZ subsystem from my SPIN/BASIC/C program as a serial device. Sending commands, receiving answers. How simple is that for any MC programmer.
Then we have 64 smart pins and a optional smart COG using 64K on the bottom of the ram and 4 pins.
one could use the power of TAQOZ one liners from any other language the P2 supports.
But I am getting ahead, first I need to get at the new serial pins running TAQOZ without the need of wiring something, just use for SPs.
Mike
No, I would have re-ordered the list like this. The OUT in that list is not changing those that follows, it is merely a special choice for Input connection.
Yep, that's the only way my Logic Analyzer can capture smart pin output states.
See here for a small example
http://forums.parallax.com/discussion/comment/1461500/#Comment_1461500
Read my code lines again. _txmode doesn't use pin inputs so has no use of mapping.
Neat. All makes perfect sense and is best way of course. It wan't mentioned in the docs so my expectations weren't that high.
uups, not sure if I can convince the rom routines to use a selector for input, will test it soon
Mike
I just remebered a while back I was messing around with smartpins and set up multiple serial Rx's looking at pin 63 set at different baidrates. Another example of input selector use.
See here
http://forums.parallax.com/discussion/168444/active-autobaud-using-multiple-smartpins
I have a PropPlug connected and can talk to TAQOZ/MONITOR while my program is running on COG1.
Using the help offered here I can listen to the answer of TACHOZ using a third pin with location -1 and it works fine out of my program.
So smart pin serial receive works with listening to the pin next to you, while it is talking to somebody else (the prop plug).
Now I just need to figure out how to trick the ROM routines to listen to a pin with different location, even better would be 2 locations.
So how do I set the B pin if I would like to look at a B or A combination, or does that not work in async serial mode?
lot's of questions,
Mike
Well done.
Mike
Over Xmas got a tooth abscess and now I’m in the middle of root canal, so pretty much just been going to work and sleeping.
As soon as the tooth settles down I’ll be back on it.