Recommend working through the Propeller Education book chapters 4,5, and 6. Also chapter 1 for coverage of hardware and code relationships. Many of your questions and issues will be resolved with this material.
ALL cogs can control ALL pins. This has bitten many who have ever used the Prop. Refer to Appendix D for a visual of this. Notice that all pins are ORed together, if any cog asserts a high, the pin will be high no matter the state asserted by any other cog. You the coder must ensure that one cogs use of the pins does not interfere with another cogs use of the same pins. Pre-planning of your I/O pins is needed. All cogs can see the state of any pin. An example cog I/O pins would be using a pin with a counter output for a clock signal. The same or different cog could use that same pin as an output and then assert high to block the clock output or low to enable clock output.
Now you have Pin 14 pulse out is low, then pulse out pin 14, when Pin 4 is pulled high. Pin 16 is low, then pulse out 16 when pin 7 pulled high. Pin 15 Dir low, goes high when pin 6 is pulled high and gives pulse out on Pin 16. Pin 13 is high, then pin 13 goes low when Pin 5 is pulled high, and give pulse out on Pin 14. I just have to arrange your code to give the pin conditions you require.
this is where the snafu begins.1; I all switches are inactive there will be a pulse on (14) and a high on pin(13).(cog0) Now if a pulse is received from serial we have to stop(cog new so the pulses and data be sent to pins(13-16) from hand controller.
I just did some quick patches to your code just to make it work. I'm running my prop with all of my input pins open , and pull each one high with a 10k resistor from the 3.3 volt supply. The outputs are just hooked up to the scope. My prop stays idle without any output until I pull a pin high. Did you change the CON to make the one direction pin low. All works great, serial terminal shows pin high or low and a count of 150000, for Move variable. The statment "other" was used before in your code to change the pulse width for the variable Moves. 15000. So now you have a control that gives you pulse out in both directions and for both motors. For now just wire some test buttons and connect outputs to you H bridge. When your basics work you can interface your serial. I don't how you plan to communicate with your serial. You can't null modem two USB ft231' s that I'm aware of.
My last program worked fine but no serial , now nothing. I copied your post word for word. Maybe I should try SPI. What kind of signal does the slave select use
All you have to do is open your propeller tool (I prefer this over IDE)and click on the spin file from the post. Or right click on the forum spin file and save it to your documents. Anyone on the forum can open this spin file and it will work exactly as I explained. I don't think I can offer any further assistance.
Comments
ALL cogs can control ALL pins. This has bitten many who have ever used the Prop. Refer to Appendix D for a visual of this. Notice that all pins are ORed together, if any cog asserts a high, the pin will be high no matter the state asserted by any other cog. You the coder must ensure that one cogs use of the pins does not interfere with another cogs use of the same pins. Pre-planning of your I/O pins is needed. All cogs can see the state of any pin. An example cog I/O pins would be using a pin with a counter output for a clock signal. The same or different cog could use that same pin as an output and then assert high to block the clock output or low to enable clock output.