ATtiny85 PWM rise/fall times - Page 1
Forum section: electronics / general

author: MarkM
author_rank: Regular Contributor
timestamp: November 18, 2015, 11:21:32 pm
content: I ran a test with the ATtiny85 5v @1mhz with a 500hz square wave at 25% duty cycle. I have a 470ohm resistor in series with the PWM pin. I used my Hantek DSO5000 series scope with the probe and software set to 1x. I'm reading the rise fall times as 20µS with nothing else connected but the scope. This seems way off to me... Is it how I'm reading it with the scope or the resistor? I couldn't find anything in the datasheet about the rise time.I'll be able to run more tests hopefully this weekend.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 19, 2015, 04:00:18 am
content: It's the 1x probe. RTFDS.Tim

author: MarkM
author_rank: Regular Contributor
timestamp: November 19, 2015, 05:36:24 am
content: Thanks, Tim. I really should have googled first. Thanks for the confirmation. I've only used a scope a few times after watching some videos and reading up, but it was quite awhile back. Need to read more and hopefully get a chance to test soon.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 19, 2015, 07:30:06 pm
content: There are only two cases where you should expect rated bandwidth:1. 10x probe reading a low impedance circuit; short lead lengths (normal size ground clip; or even, no clip and probe tip at all, using a socketed connection instead),2. 50 ohm matched generator and terminated scope (50 ohm internal termination enabled, or using a tee and terminator at the scope input).Anything else, do your due dilligence.As noted, 1x probes are quite slow, and add a lot of capacitance to the circuit. A 10x probe has less capacitance, but it will easily disturb precision, high impedance, or tuned RF circuits. A 500 ohm 'no probe' (450 ohms + 50 ohm terminated cable, reads 10x) can have pretty good response, but loads the circuit much more at lower frequencies.The most important takeaway is perhaps: reciprocity. There is no ideal probe. We can approximate certain characteristics (like high DC resistance, or wide bandwidth), but there are fundamental limits on what equivalent capacitance, bandwidth, voltage range, noise floor, etc. can be had. There is always necessarily a loading effect on the circuit-under-test, which is to say, a probe necessarily exhibits an RLC equivalent circuit -- it's never an ideal open circuit (infinite impedance). Keep this in mind when performing measurements: rather than trying to avoid those properties (e.g., using a low capacitance FET probe to measure logic signals), try to work with them (e.g., using a probe of known capacitance to measure logic signals -- a capacitance which is representative of a real circuit using those signals!).And reciprocity takes you quite some distance in general, because all passive circuits interact in both directions. You can't build an RLC filter without it! Amplifiers (and a few other peculiar components) are actually the odd ones out, because they can disobey reciprocity: having gain for one thing, but also having unequal forward and backward gains.Tim

author: MarkM
author_rank: Regular Contributor
timestamp: November 19, 2015, 08:54:33 pm
content: Thank you for the reply. Makes sense. I tried again with the probe and software set to 10x and it still reads 20µS. Good news is the project works just fine how it is so it's OK.Bad news is this scope won't self calibrate and CH1 reads ~400mV higher than it should. Tried with different probes etc. Got it second hand in what looked like new condition with the box and everything. When I get some time I'm going to have to dig in and learn more about them and hopefully make this one work correctly. CH2 is working how it should, though.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 19, 2015, 11:28:12 pm
content: Oh, um... you did zoom in on the edge you were trying to measure, right?Tim

author: nuno
author_rank: Frequent Contributor
timestamp: November 20, 2015, 03:00:44 am
content: Never measured an ATtiny85, but already did a ATtiny26, with a Rigol DS1052E, and it was around 16ns rise/fall totally unloaded. I think you should expect similar on the 85.

author: westfw
author_rank: Super Contributor
timestamp: November 20, 2015, 05:58:30 am
content: QuoteDo you mean 20ns? I don't see how you could be measuring 20us rise time on a 1Mhz signal...

author: MarkM
author_rank: Regular Contributor
timestamp: November 23, 2015, 04:24:34 am
content: Quote from: T3sl4co1l on November 19, 2015, 11:28:12 pmThis was the issue. Just a simple case of not knowing what I'm doing with the scope.Thanks for your replies.