Clocks
RogerInHawaii
Posts: 87
I'm having some really odd behavior with a circuit and am hoping someone might have some insight.
I have a Propeller driving an Acam TDC-GP2. That's a high-resolution timing chip. I can successfully communicate with the TDC-GP2, sending it op-codes and retrieving register data from it. The next step is to get the TDC-GP2 to do a self-calibration. Sometimes it works, sometimes it doesn't, and I'm having a heck of a time figuring out why.
The difference between doing the simple send-op-code-retrieve-register-data communication and the self-calibration is that the self-calibration makes use of the two clock circuits attached to the TDC-GP2, so I suspect that there's something wrong with one of those clocks. There is a 32kHz oscillator circuit and a 4MHz oscillator circuit connected to the TDC-GP2. When I first tried doing the self-calibration is worked fairly consistently. But over time it worked fewer and fewer times, and now it hardly ever works.
I suspected that perhaps there wasn't good connection between the clock circuit (in particularly the 4MHz circuit) and the TDC-GP2. After all, the TDC-GP2 is an incredibly small (about 1/4" square), surface mount component with 32 connections. I use a Schmartboard for the mounting of the TDC-GP2, and even with a microscope it's difficult to see if the solder connections are actually good.
I decided to check the connections between the 4MHz clock connections (pins 1 and 2 on the TDC-GP2) and ground using a simple voltmeter to check the voltage. It turns out that the voltage measurements are about 1.5 volts. Now comes the really odd behavior. When I have the voltmeter probes touching a clock pin and ground, the self-calibration operation actually produces values! Normally, when it's not working, the calibration value that it produces is 0 or -1, indicating some sort of error (although not telling me WHAT kind of error, darn it). But when the voltmeter probes are connected the TDC-GP2 actually produces reasonable (or at least-non-error) values!
How in the world can the connection of voltmeter probes have an effect on the behavior of the TDC-GP2?
One thing I noticed is a bit of a discrepancy in clock circuits. The documentation for the TDC-GP2 shows a 4MHz ceramic resonator, a couple of capacitors, a 560 K Ohm resistor in parallel with the resonator and a 220 Ohm resistor in serial with it. That's what I implemented in my design, using the 4MHz ceramic resonator available from Parallax. But then, looking around the Parallax site, I find that that 4MHz ceramic resonator is used in the basic design of the Stamp 1. But all it uses is just the resonator. It does not employ any capacitors or resistors. Should I try using just the resonator and get rid of the other components?
I realize that this isn't really a question about the Propeller, but you guys have been so helpful with my other questions I'm hoping you can provide some insights into why I'm having trouble with this other circuit.
Thanks,
Roger
I have a Propeller driving an Acam TDC-GP2. That's a high-resolution timing chip. I can successfully communicate with the TDC-GP2, sending it op-codes and retrieving register data from it. The next step is to get the TDC-GP2 to do a self-calibration. Sometimes it works, sometimes it doesn't, and I'm having a heck of a time figuring out why.
The difference between doing the simple send-op-code-retrieve-register-data communication and the self-calibration is that the self-calibration makes use of the two clock circuits attached to the TDC-GP2, so I suspect that there's something wrong with one of those clocks. There is a 32kHz oscillator circuit and a 4MHz oscillator circuit connected to the TDC-GP2. When I first tried doing the self-calibration is worked fairly consistently. But over time it worked fewer and fewer times, and now it hardly ever works.
I suspected that perhaps there wasn't good connection between the clock circuit (in particularly the 4MHz circuit) and the TDC-GP2. After all, the TDC-GP2 is an incredibly small (about 1/4" square), surface mount component with 32 connections. I use a Schmartboard for the mounting of the TDC-GP2, and even with a microscope it's difficult to see if the solder connections are actually good.
I decided to check the connections between the 4MHz clock connections (pins 1 and 2 on the TDC-GP2) and ground using a simple voltmeter to check the voltage. It turns out that the voltage measurements are about 1.5 volts. Now comes the really odd behavior. When I have the voltmeter probes touching a clock pin and ground, the self-calibration operation actually produces values! Normally, when it's not working, the calibration value that it produces is 0 or -1, indicating some sort of error (although not telling me WHAT kind of error, darn it). But when the voltmeter probes are connected the TDC-GP2 actually produces reasonable (or at least-non-error) values!
How in the world can the connection of voltmeter probes have an effect on the behavior of the TDC-GP2?
One thing I noticed is a bit of a discrepancy in clock circuits. The documentation for the TDC-GP2 shows a 4MHz ceramic resonator, a couple of capacitors, a 560 K Ohm resistor in parallel with the resonator and a 220 Ohm resistor in serial with it. That's what I implemented in my design, using the 4MHz ceramic resonator available from Parallax. But then, looking around the Parallax site, I find that that 4MHz ceramic resonator is used in the basic design of the Stamp 1. But all it uses is just the resonator. It does not employ any capacitors or resistors. Should I try using just the resonator and get rid of the other components?
I realize that this isn't really a question about the Propeller, but you guys have been so helpful with my other questions I'm hoping you can provide some insights into why I'm having trouble with this other circuit.
Thanks,
Roger
Comments
Voltmeters aren't much use for checking oscillators, a scope and high impedance probe will help a lot more.
If you have used a two-terminal resonator, you need to include two feedback capacitors. Three terminal resonators include the capacitors.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Post Edited (Leon) : 6/1/2009 8:36:26 PM GMT
The actual 4MHz component is the one availbale from Parallax: http://www.parallax.com/Store/Components/ResonatorsCrystals/tabid/153/CategoryID/53/List/0/SortField/0/Level/a/ProductID/359/Default.aspx
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
But does it need those resistors as well? Or should I just connect the resonator directly to the Xin and Xout pins (and ground)?
No, no scope. Only the most rudimentary electronics equipment, i.e. a multimeter. I know, I know, I'm building a complex high-speed project and trying to do it with paper clips and rubber bands (not even duct tape).
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
I removed the resistors since, as indicated, they are more appropriate for a crystal, and the resonator that I'm using is a ceramic resonator, and I removed the capacitors since the ceramic resonator has those built in to it. That leaves just the ceramic resonator connected to Xin ad Xout and its central pin connected to ground.
And it doesn't work. Whereas before if I put my voltmeter probes across Xin and ground or Xout and ground it would cause it the TDC-GP2 to occassionally generate reasonable calibration numbers (possibly due to inadvertantly modifying the capacitance), now it consistently generates the error value (all 1s) for the self-calibration number.
So, this seems to be a step backwards.
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 6/2/2009 1:52:21 AM GMT
do you have circuit diagram TDC-GP2 for liquid level?
Best Regards.
One approach would be to pull out the xtal and feed 4mHz directly to Xin (4 mHxz perhaps from a Prop counter output). See if the circuit operates. Monitor the output on Xout. That would verify the solder connections.
Link for the TDC-GP2 data sheet?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
It's interesting that you suggest replacing the 560K resistor with a 100K resistor. On the chip's datasheet it shows a sample circuit with a 560K resistor, but on the evaulation system specs it shows 100K.
I've got the clock circuit as close as I can get it to the chip.
Can I really generate a 4MHz clock directly form the Propellor? that would be great. Exactly what code would I need to do that? Can it also generate the 32kHz clock? It would be great if I could simply eliminate the clock circuits from the TDC-GP2 and replace them with simple lines from the Propellor.
- Roger
heres an example of generating 32K I use - the A is whether to use counter A/B, so if you are using it twice, dont forget to use B in the 2nd.
freq.Synth("A", _mclk, 32768) 'start clock 32KHz for A2D
Thanks, I'll give that a try.
- Roger
Thank you so much. That works! I was able to get rid of the clock circuits and just use your suggested code and direct line from the Propellor to th TDC-GP2 chip.
Excellent!
- Roger
·
I am just starting to experiment with the TDC-GP2 chip, would you be kind enough to share the code you used to communicate with the chip?
Is it in 'C' or Assembler?
Ciao,
Diego from Italy