Hi ! James Nick Sears wrote : > Thanks again to Jan for the correction on the operation of > the PIC PORTs. I made this change (to tri-state the PIC > pins instead of forcing them low) and still the original > problem exists. That is - if I sample every 1s (2s is > borderline - sometimes works, sometimes doesn't (right now I > tried and it worked at least for 15 samples)) I miss every > other sample because the reference voltage doesn't come on > properly. I have taken thousands (I think it was just over > 9k) of consecutive samples with a 5s interval with no errors. Sampling ? I must have completly missed what you actualy are trying to do and just focused on the PORT/TRIS thing... So your PIC pin is connected to the input side of a LT1790 voltage reference ? Connected according to the picture on page 1 in the data sheet ? With a 0.1uF cap on the same side as the PIC and a 1.0uF cap on the output side ? What else is connected to the output side of the LT1790 ? What is a "sample" ? > I noticed when looking at the PIC pin that powers the > reference IC with the sampling interval set to 1s that > there are two alternating pulse shapes. > Both quickly rise to 5V (looking at 50ms/div) and hold for > about 25ms but then one will decay gradually from the full > voltage with a time constant of ~50-75ms while the next will > quickly decay to about half voltage and then show an > exponential decay from that point. Sounds as your PIC pin isn't held as an active high for more then about 25 ms. After that it's probably set high-Z and you are seeing the decay of the charge in the cap on the input side of the LT1790 (if connected according to the data sheet). If the PIC pin was to be set *active* low, the cap would discarge into the PIC pin. This might not be a good thing. I'd protect the PIC pin from exessive current to/from the cap using a series resistor. > > When I set the sample interval to 5s (and everything works > properly) I see the second waveform on the PIC pin that > powers the reference (drops to half voltage then exponential > decay from there). > > So it seems that the variance in waveforms is just a symptom > of the fact > that the reference isn't delivering the proper voltage and thereby is > drawing less current and discharges the cap more slowly. Yes, but is the PIC pin still high ? Should it be ? > But why would this happen? Even with the sample interval set > to 1s and tri-stating the PIC pin that powers the reference > rather than forcing it low, the power to the reference goes > to 0 for at least a couple of hundred ms between samples. And what *should* happen here ? Should it go to 0 for a longer period ? A shorter period ? Or maybe not at all ? > I have checked the LT1790 datasheet ( > http://www.linear.com/pdf/1790fa.pdf ) a few times and don't > see anything regarding this issue. To me at least, the "issue" isn't very clear... You have olny said what actually happens, not what you'd *want* to happen. I must have missed something at the very beginning... :-) :-) Regards Jan-Erik. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu