Need Some Help
GeofPrice
Posts: 16
Hi All:
I am new to developing stuff with propeller chips, but I'm on my second project now. This application I'm having trouble with reads inputs from a Linx Technologies wireless decoder controller which is controlled by a 5 button key fob. Either of two keys on the key fob turns on/off the receiver/decoder and toggles P24 and P25 on a Propstick. P0 on the Propstick outputs to a Pololu 18v7 motor controller, and the motor controller runs a relatively small motor. Also, a set of 4 dip switches can be used to adjust on/off period for the motor. The wireless is intended to kill all juice to the motor.Schematic is attached.
I developed a Spin program that works perfectly. It reads the four dip switches, sets the on/off times, toggles the motor correctly, and the key fob kills/restores all power on command. So after all the debugging is done and I am satisfied with the program. I upload the program to EEPROM. Now, as long as the USB is connected to the external computer, everything woks perfectly. I can power down with the main power switch (USB power is still applied through the computer), and power back up and the EEPROM program loads and life is great. Then I turn everything off, disconnect the USB, and turn it back on. Now, nothing works. The motor comes up with about 20% power when it should be 100%. I don't have a scope, but I suspect that P0 is oscillating rapidly, because when I try to read the voltage P0 is putting out with a voltmeter, the motor kills while P0 reads about 0.35v. Also, even though the decoder will toggle P24 and P25 just fine, there is no response that makes it through to P0 via the program. The 4 dip switches also have no effect on P0 through the program. However, even in this strange state, if I plug back in the USB, everything comes back to normal, and everything works again, even without rebooting the propeller.
Can anyone tell me what might be going on here? Why would the USB need to be connected to the Propstick for this to work? I can upload the program if someone wants to see it, but this seems to be a hardware problem to me.
I am new to developing stuff with propeller chips, but I'm on my second project now. This application I'm having trouble with reads inputs from a Linx Technologies wireless decoder controller which is controlled by a 5 button key fob. Either of two keys on the key fob turns on/off the receiver/decoder and toggles P24 and P25 on a Propstick. P0 on the Propstick outputs to a Pololu 18v7 motor controller, and the motor controller runs a relatively small motor. Also, a set of 4 dip switches can be used to adjust on/off period for the motor. The wireless is intended to kill all juice to the motor.Schematic is attached.
I developed a Spin program that works perfectly. It reads the four dip switches, sets the on/off times, toggles the motor correctly, and the key fob kills/restores all power on command. So after all the debugging is done and I am satisfied with the program. I upload the program to EEPROM. Now, as long as the USB is connected to the external computer, everything woks perfectly. I can power down with the main power switch (USB power is still applied through the computer), and power back up and the EEPROM program loads and life is great. Then I turn everything off, disconnect the USB, and turn it back on. Now, nothing works. The motor comes up with about 20% power when it should be 100%. I don't have a scope, but I suspect that P0 is oscillating rapidly, because when I try to read the voltage P0 is putting out with a voltmeter, the motor kills while P0 reads about 0.35v. Also, even though the decoder will toggle P24 and P25 just fine, there is no response that makes it through to P0 via the program. The 4 dip switches also have no effect on P0 through the program. However, even in this strange state, if I plug back in the USB, everything comes back to normal, and everything works again, even without rebooting the propeller.
Can anyone tell me what might be going on here? Why would the USB need to be connected to the Propstick for this to work? I can upload the program if someone wants to see it, but this seems to be a hardware problem to me.
Comments
Other possibilities are that the program is expecting some input from the prop plug or is being reset by the /res line.
The Pololu motor controller has a 5v regulated supply that provides power to the Propstick.
This may also be a cause for the problem. When a motor starts it draws a heavy current which may cause a reset. Can you post a schematic for the controller?
http://www.pololu.com/docs/0J44/all
The program does have serial communications. I will eliminate those and see.
"Yellow Status LED
This LED helps you visually identify the state of the device, which can be useful when the controller is not connected to the Control Center. On start-up, the status LED briefly flashes a pattern indicating the source of the last reset (see the Reset Flags variable in Section 6.4 for more information):
8 blinks over the first two seconds after start-up indicates that the external RST pin was driven low to reset the controller.
3 blinks over the first two seconds after start-up indicates that the controller last reset because logic power got too low (power was disconnected or the controller browned out).
Rapid flickering for the first two seconds after start-up indicates that the controller was reset by a software fault or by a firmware upgrade.
This startup behavior can help you detect if your Simple Motor Controller is browning out and resetting unexpectedly (as can happen if your input voltage drops due to high power demands or electrical noise)."
Just for completeness, the LED that I mentioned was meant to aid in debugging the problem. Any old LED would work, and if you connect it to an unused propeller pin you can use the following code at the beginning of you program: Correctly functioning code will have the LED turn on once, and then remain off. With the bug that you encountered the LED would flash or remain on.
1. Connect an LED with a series current limit resister from Pin to Gnd.
2. Add some code to your program to continuously output a high to this pin to light up the LED.
3. See if it is lit steadily or not.
When the Prop is reset the pins all go to input mode so the LED will go out.
Duane J