Is there a way to do a serial "pass through" ?
Don M
Posts: 1,652
I have the Prop Plug USB connected to pins 30 & 31 and I have a bluetooth module connected to pins 6 & 7.
Lets say I wanted to utilize a setup program from the manufacturer made for the bluetooth module that communicates via the pins on the module that are connected to the Prop's pins 6 & 7 just for the purpose of making some changes to the module.
Is there a way using FDS to pass the data coming in on pin 31 to be passed on to pin 7 and data from pin 6 passed on to pin 30? It's @ 19.2K.
Any suggestions ?
I hope this makes sense the way I explained it here.
Lets say I wanted to utilize a setup program from the manufacturer made for the bluetooth module that communicates via the pins on the module that are connected to the Prop's pins 6 & 7 just for the purpose of making some changes to the module.
Is there a way using FDS to pass the data coming in on pin 31 to be passed on to pin 7 and data from pin 6 passed on to pin 30? It's @ 19.2K.
Any suggestions ?
I hope this makes sense the way I explained it here.
Comments
PASM is out of my league.
-Phil
I wrote a simple bridge program for the SayIt module to this sort of thing. If timing isn't critical, then a simple Spin loop would work. The PASM version should be pretty simple too but I don't have an example ready.
This untested code should work: Andy
Phil's idea would work and Kuroneko's post shows how it's done in pasm. If you want I could write the pasm code for you.
So for instance when I want to communicate to the module via the external program I would just load a blank program to the Prop?
Or just stop the FDS methods for the serial terminal and the module?
Would the pins on the Prop just go to high impedence and then not interfere?
Andy I tried your code and I don't get anything. I put the Saleae logic analyzer on the pins and there isn't any data at all.
Here is what I loaded onto the Prop:
Am I doing something wrong?
kwinn- By all means I'd love to see your solution.
kuroneko- Thanks! That works.
Duane- I tried your method but couldn't get it to work. Maybe 19.2K is too fast for Spin trying to keep up with?
I just looked at the program again and I see it doesn't pass on nul characters. The SayIt GUI never transmits a nul and I was having trouble with the FDS treating an inactive line as if it were receiving nul characters since FDS doesn't check for framing errors.
It's also possible the buffers weren't large enough.
If I were to write the program again, I'd use two copies of Tracy Allen's four port serial driver. If you try this, make sure and make a small change to the object and save as another name. It wouldn't work correctly if you just use two instances.
If you want to go this route and need assistance let me know and I'll be glad to help.
Well Phil, it looks like your idea is wrong, it is too simple and as we know on this forum many seem to offer or look for a complicated solution. This is a solution I have used for pass-through on some designs and it just works, but once again, it's too simple.
-Phil
Always!
I was thinking of something similar to what Andy posted although I doubt mine would have been quite that good. The only addition I was thinking of was a way to stop and start it from spin.
You read my mind. I was thinking last night how that might be done.
Andy
Thinking out loud here- if I have a main method that is working with FDS in a "menu" type setup and let's say it is running in a loop and I defined a particular character to start the PassThru. When it sees that character the PassThru starts in another cog while still in the main method FDS is watching for a "cogstop" character that I also defined.
When the PassThru starts I'd disable PST and run the external program to communicate with the module. When done with that I'd enable PST to send the "PassThru cogstop" command.
Sounds confusing I know.....
Definitely easier but it takes time to restart it. I was thinking of something that could be stopped and restarted quickly.