Prop To Prop Signaling, Not Serial Communication
idbruce
Posts: 6,197
Hello Everyone
Someone from Parallax once told me how to do this, but I forget the exact details. Anyhow here is what I want to do. I want to use a pin on Prop One to force a pin on Prop Two to go LOW. What are the exact details and hookup? My cable length is two feet, and I believe I was told it could be done with two wires and with or without a resistor. Any help that you may provide in providing a good outline will definitely be greatly appreciated.
Bruce
Someone from Parallax once told me how to do this, but I forget the exact details. Anyhow here is what I want to do. I want to use a pin on Prop One to force a pin on Prop Two to go LOW. What are the exact details and hookup? My cable length is two feet, and I believe I was told it could be done with two wires and with or without a resistor. Any help that you may provide in providing a good outline will definitely be greatly appreciated.
Bruce
Comments
Note: Input pins should never be without a pull-up or pull-down. The scheme described above assumes you will never drive either pin high as this could cause a short circuit if the other is driven low. On the slave side you can use this method to get the status of your input pin (0 = active, 1 = not active)
Bruce
The wave player was working without relying on a input for a trigger, so the problem definitely lies in the trigger or the code for the trigger.
Here is my code sent from the Master
And here is the code for receiving by the Slave
The idea is to wait for Pin 4 to go low and then play a wave file on Pin 7.
Below you will find a schematic of the hookup between the slave and the master.
Do you guys see anything obvious?
Bruce
Yes, SOUND_OUTPUT is Pin 10 on the master.
If I run the master code, the slave does not play the wave file
I have not tried WAITPNE. I was also thinking that it may be to fast a signal, but I was not sure. What about making the trigger from the master a little longer with something like this?
Update: The slave repeat loop in it's current form can't keep up it seems. I sent pulses once every second and I don't get a nice blink effect. So either widen the pulse or use a form of waitpxx on the slave side (provided that's all the loop does).
How can I ascertain whether the slave actually receives the pulse? LOL I was relying on the wave sound for that
And then I altered the slave code as follows and the wave file plays on startup, but does not play from the code above.
And now I am going to try the following
Just occured to me that if you widen the pulse you may start several cogs trying to play the wave file which will have interesting results (pin/stack usage). So keeping the pulse small and waiting for it may be better.
Bruce
Okay here is the scenario.
- When the interface receives the signal from the bender cnc, I am going to have it output to the piezo siren instead of the wave player, just to verify that the interface is getting and sending signals at the appropriate time.
- I am going to fabricate a LED test rig to replace the wave player. Dependant upon the outcome of the test, I will either switch input pins on the wave player, or I will check the integrity of circuitry of the interface board. Hopefully, the problem lies in the wave player, because that is much easier to work on.
BruceEDIT: Additionally, I have another hard to find problem within the cnc machine, and this current problem may help me find the other problem.
Bruce
The bender cnc communicates with the interface properly, and the interface is capable of sending a signal on Pin 10, as proven with the code below. Which further establishes that Pin 10 and the cable are okay. The test code below lit up a LED for 1 second at the appropriate time. The problem must lie in the circuitry of the wave player or Pin 4 within the wave player is bad.
Bruce
I will now add a permanent LED to the wave player for future diagnostic situations. I will also alter that code so that it does not rely on the same stack. That was just for test purposes anyhow.
Test code for slave (wave player)
Test code for the master
Alright now here is the results.
- With the slave operating by itself, with no cable attached from the master, the LED does not light.
- With the cable attached, and no power going to the master and no signal coming from the master, the LED turns on and off approximately every second, with a very short off time.
- With the cable attached, and power now provided to the master or signal sent from the master to the slave, the LED turns on and off approximately every second, with a very short off time.
I hate to say it, but if that wiring diagram provided earlier looks correct, than I would say that something is wrong with Pin 4 on the Slave or with Pin 10 on the Master.However, as previously mentioned, I was having other issues with losing power to that board and this may have something to do with that. So perhaps this is a blessing in disguise.
Bruce
Bruce