I have four propellers working together to create a timing system for a drag race. Each propeller is connected to a F4232H mini module, creating 4 separate serial ports. The propellers communicate to a computer via their serial port. I am using the extended fullduplexserial.
I have the code setup as followed:
startc := "0"
repeat until startc == "A"
The program starts by figuring out what chip it's talking to. It waits for "A," to be written to the serial port where it then sends back a string - either "L", "R'", "S", or "T"
Then the readSerial cog is started where it reads the incoming strings from the computer program. The code is as followed:
readBuffer := "0"
repeat until readBuffer <> "0"
if readBuffer == "A"
After it initially tells the computer what propeller is communicating with and starts the readSerial cog it will loop through until readBuffer doesn't equal 0. There are many strings that can be sent to the computer, but the biggest one is if it equals "A" again. If it equals "A" then it tells the computer to "RESET", telling the user that the propellers need to be reset.
Here's where my problem comes. Every once in a while (becoming more frequent for some reason) it's like (some) propellers are constantly resetting. I say some because it's not every chip. If I write "A," to the com port I'm expecting to get the identifier back (R, L, S, or T) and if I write "A," once more, I'm expecting to get the reset flag. Now, sometimes this works as expected. Other times, I don't get anything back and have to write it again only to get the identifier. The identifier keeps getting sent. Like I said, it's not every chip. For example the "T" chip will send the reset flag and the other 3 won't.
It's almost like the first part of the code (before the readSerial cog starts) is constantly on repeat.
Now, I added the code just so you can get a better idea of what the program is doing. I don't think this is a code issue. I hope that it makes sense and someone can give me some pointers as to what's happening and how to troubleshoot it. I switched power supplies, unhooked the reset button, basically stripped all the inputs from the propellers just to make sure nothing was shorting the board. I have to have this fixed in order to use this project, it's useless when only the first 5 lines of code works. I should add that I'm not an expert in electrical engineering. My programming experience is in windows software and web design, with the basic stamp and propeller fairly recently.