John Thompson
New Member
I have a circuit an program using a Pic 12F683 that has 3 switches connected which drive their respective 3 servos connected to 3 outputs to one end of their travel or the other. To do this there are three identical blocks of code, one for each switch input/servo output pair.
The code de-bounces the switch and then if the switch position has changed sends 25 20ms frames of 1 or 2ms on times to the servo.
The code works just fine in the simulator. All the variables change as expected, the output poins pulse as expected in response to switch changes.
But when loaded into a Pic and the PCB tested nothing happens. My logic analyser detects the switch changes, but no resulting pulse train on any output no matter what the switch position. The servos stubbornly remain in their start position. The only sign of life is that with the switch off the voltage on the input pins read 3.45v (5v supply), which indicates the PullUp setting part of the code is working.
I have checked the program to death, especially the register and config settings, and ditto the PCB. Can't see any problem, and have reached the point where if there is a mistake I am missing it every time. Fresh thought are needed.
Anyone have a suggestion on how best to proceed?
The code de-bounces the switch and then if the switch position has changed sends 25 20ms frames of 1 or 2ms on times to the servo.
The code works just fine in the simulator. All the variables change as expected, the output poins pulse as expected in response to switch changes.
But when loaded into a Pic and the PCB tested nothing happens. My logic analyser detects the switch changes, but no resulting pulse train on any output no matter what the switch position. The servos stubbornly remain in their start position. The only sign of life is that with the switch off the voltage on the input pins read 3.45v (5v supply), which indicates the PullUp setting part of the code is working.
I have checked the program to death, especially the register and config settings, and ditto the PCB. Can't see any problem, and have reached the point where if there is a mistake I am missing it every time. Fresh thought are needed.
Anyone have a suggestion on how best to proceed?