okay i've just built this project thing i was doing but it doesn't work
i've got the schematic and the code below
what is meant to happen is that when pic1 receives/detects a valid signal (of 2.094ms) from the rf receiver its connected to, it is meant to form its own pulsed output signals, which PIC 2 detects and generates specific outputs for.
can anyone look at my codes and schematic to see where the error lies??
okay i've just built this project thing i was doing but it doesn't work
i've got the schematic and the code below
what is meant to happen is that when pic1 receives/detects a valid signal (of 2.094ms) from the rf receiver its connected to, it is meant to form its own pulsed output signals, which PIC 2 detects and generates specific outputs for.
can anyone look at my codes and schematic to see where the error lies??
Why are you using two PIC's?, one should be plenty?.
For a start, simply connect an LED (with resistor) to an output pin of a single PIC, and use it to detect the incoming pulse - lighting the LED when it's correct. You could also have two other LED's, one which lights if it's too low, one if it's too high.
In this way you can test your pulse detrction routines to prove that part is working fine.
I would also suggest you try mentioning EXACTLY what you are attempting to do?, instead of just asking for what you think you need.
reads the high input pulse, which should be about 2.094ms
then does a subtraction to test for tolerance meaning, i set a max value of maybe 2.2ms and a min value of 2ms and subtract it from the value read by the TMR0.
I bit test the carrier flag of the status register after subtracting the min and expect 0 and do the same after subtracting the max, expecting 1.
when it passes this stage, i create pulses that will be sent to pic 2, which in the major project will be transmitter by infrared
when pic two receives the signal, it will do a tolerance test like pic 1, in which when it passes, it sends uses a relay to cut out information to servos attached to it.
the info line in the test circuit is the line that carries the input signal from the rf receiver to the pic
this is a test circuit i built to make sure my code is working correctly
You could use a simple transistor inverter, which would invert the data, but you simply adjust your PIC program to correct for it.
But there's no need, a PIC should happily and reliably read a 3V logic signal.
I would suggest your best solution is to use some type of display to show what's happening, and get the pulse reading and checking working before you try and go further. If you have an LCD module you could use that, or (as you obviously have a computer) use an I/O to feed RS232 to the PC, and display it using Hyperterminal (or similar).
oh and THE CIRCUIT WORKS , well half of it (pic one operation)
there must be an error in my code for PIC two
oh and this is not the main project, it is a test circuit to show that my code works. Main project requires two pics in two seperate areas of a toy car using the same codes