JudiR
Keen DIYer
Posts: 11
|
Post by JudiR on Oct 16, 2010 16:33:36 GMT
I'm hatching a plan to drive the decoders through a radio link and am trying to understand how your PIC is configured. I see from the circuit diagram that the digital inputs to pins 6 & 7 are fed through resistor droppers of 10k + 2k2 which gives an input voltage of approx 2.5V.
Pins 6 and 7 are complementary so, my question is: do they need to be? The output from my radio module would be single sided, not push-pull. So would I need to recreate this using an inverter?
I've posed this question here but I would need to apply the answer to the function decoder too. I believe that the input side is the same and it's only a "simple" re-write of the code that decides what sort of decoder it is.
Judi
|
|
|
Post by Paul Harman on Oct 18, 2010 9:01:43 GMT
There are two solutions to this.
1. Hardware
The input on pins 6 and 7 is an analogue comparator, so as long as one of the pins is between the supply rails you can apply a digital (or analogue) input to the other pin. This will probably work well if you are using the raw analogue output from a PLL detector because it will still decode weak signals pretty well, and should be better than putting the analogue through a schmitt trigger to square it up.
2. Software
The code just monitors the internal flag that shows the state of the comparator output. This can easily be modified to look at the state of pin 4 instead. You will only need to change two instructions to do this.
Changing one further instruction will allow you to switch off the comparator and use pins 6 and 7 as digital outputs E and F on the function decoder giving five outputs. Outputs C, G and H will require a 14 pin chip still so probably not worth going down the software route.
|
|
JudiR
Keen DIYer
Posts: 11
|
Post by JudiR on Oct 18, 2010 15:40:13 GMT
Paul,
Thanks, I will go with the hardware solution!
The output from the radio module is available as an open collector that replicates the transmitted data stream, so I could use that with a pull-up resistor to drive pin 6 and, if I understand you correctly, hold pin 7 at mid volts with a resistor divider between 5V and 0V? Would 10k be suitable values for these three?
Judi
|
|
|
Post by Paul Harman on Oct 19, 2010 7:40:02 GMT
You can use the junction of R14 and D2 as a suitable reference. 1N4148 diodes are cheaper than resistors!
A couple of 10K between 5V and 0V should make a good potential divider. If you are driving a motor with the L272 you will need the potential divider for that as well if you do not have R14 and D2. It is easy to replace D2 with a resistor on the stripboard layout to create the potential divider that way and replace R4 with a link and omit R1, R2 and R3.
|
|
JudiR
Keen DIYer
Posts: 11
|
Post by JudiR on Oct 19, 2010 23:10:25 GMT
Thanks, Paul. I'll let you know how I get on!
Judi
|
|