On the other hand==>
Look at this great oscilloscope-like picture of the PWM pulses (fifty per second) very close to 1.75ms long created by Bruce's PAUSEUS technique. I finally figured out the Analyzer part of the PICkit 2 Logic Tool.
Ken
On the other hand==>
Look at this great oscilloscope-like picture of the PWM pulses (fifty per second) very close to 1.75ms long created by Bruce's PAUSEUS technique. I finally figured out the Analyzer part of the PICkit 2 Logic Tool.
Ken
Fritsl's code compiles and runs on my PICkit2.
The proximity detector (Devantech SRF05) responds with different size pulses (depending on the distance from it to an echoing object) when queried by this code.
Next to prove out control of the four DPDT switches which steer DC to the motor and to the servo, destroy the toy car by ripping out its radio receiver. and figure out how to mount the PICkit, the switches board and the two SRF05's.
Question. Is there any way that I can read through the PICkit programmer what is happening in real time to some of the variables. How do I think about adding debugging code?
Ken
In case someone wants to measure multiple RC channels with one CCP1 pin, I did a small expermiment. If you connect every other RC receiver channel to CCP pin using 1N914 diodes (or similar), you will be able to measure pulses from three (or four) RC channels using one pin. Without the diodes, the RC channels that are low, ground out the one that is trying to pulse.
Here is a picture of RC channels 2,4, and 6. Without a channel space between them, they stay high. So, with a PIC that has two CCP pins, you should be able to read all 8 channels!
This picture shows scope yellow probe (rc 2, 4, and 6) with their diodes attached to the scope probe. and scope red probe directly attached to RC channel 2.
![]()
Last edited by ScaleRobotics; - 7th February 2010 at 02:18.
Come to think of it, using one CCP pin, you can decode (however many channels your RC transmitter has - 1). So, using a 6 channel transmitter, you can decode 5 channels using a chip with a single CCP compare pin. To do this, connect RC1, RC3 and RC5 channels from your receiver to the CCP pin with some diodes, and a pulldown resistor. Then capture every transition with capture. The in between pulses are RC channels 2 and 4.
Now to write some code...
![]()
Individually the parts of the system seems to pass their tests.
The DPDT switches worked according to their truth tables.
The proximity switches echoed what looked like sensible responses.
The wheels turned and the steering responded as the DPDT switches asked of them.
However, the car does not work as a system. The PIC is running. The proximity sensors have LED's that blink when pulsed. These work. After a while the proximity detectors stop. All this is in the code, but the steering does not move at all. The wheels do not reverse when something is seen to be right in front of the car.
Question is: What kinds of debugging power do I have once the code is in the PIC besides the Logic Tool Analyze mode?
Ken
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks