Author Topic: ATtiny85 PWM rise/fall times  (Read 3929 times)

0 Members and 1 Guest are viewing this topic.

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
ATtiny85 PWM rise/fall times
« on: November 18, 2015, 11:21:32 pm »
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.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21697
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: ATtiny85 PWM rise/fall times
« Reply #1 on: November 19, 2015, 04:00:18 am »
It's the 1x probe.  RTFDS. ;)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: ATtiny85 PWM rise/fall times
« Reply #2 on: November 19, 2015, 05:36:24 am »
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.
« Last Edit: November 19, 2015, 05:43:06 am by MarkM »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21697
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: ATtiny85 PWM rise/fall times
« Reply #3 on: November 19, 2015, 07:30:06 pm »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: ATtiny85 PWM rise/fall times
« Reply #4 on: November 19, 2015, 08:54:33 pm »
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.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21697
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: ATtiny85 PWM rise/fall times
« Reply #5 on: November 19, 2015, 11:28:12 pm »
Oh, um... you did zoom in on the edge you were trying to measure, right?

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: ATtiny85 PWM rise/fall times
« Reply #6 on: November 20, 2015, 03:00:44 am »
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.

 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: ATtiny85 PWM rise/fall times
« Reply #7 on: November 20, 2015, 05:58:30 am »
Quote
it still reads 20µS.
Do you mean 20ns?  I don't see how you could be measuring 20us rise time on a 1Mhz signal...
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: ATtiny85 PWM rise/fall times
« Reply #8 on: November 23, 2015, 04:24:34 am »
Oh, um... you did zoom in on the edge you were trying to measure, right?

Tim

This was the issue. Just a simple case of not knowing what I'm doing with the scope.

Thanks for your replies.  :D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf