testing atmegas with scope....

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello happy lovelies. I am doing an investigative study into the arduino and audio/DSP capabilities(8 bit not 32) and want to do some tests of the clock speed, timer speeds according to certain overflow values, pwm, interrupts etc... I would like to do this using an oscilloscope. If anyone has any tips or experience in doing this, I would appreciate any sharing of this information. I have 2 analog scopes here @ home but they only go up to 10mhz so I'm guessing I'd need a digital one... If anyone of you
Lovely people could help I'd be very happy,
Thanks,
Steve.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want to do accurate timing, buy a cheap Logic Analyser. Or just use another AVR (with a crystal).

Most Arduinos use a ceramic resonator rather than a quartz crystal. So the accuracy is crap.

Your Analog scope is ok for looking at the 'shape' of a signal but you can hardly measure time better than about 5%. This is plenty good enough to see if you have got a Timer 10x too fast or slow.

On the other hand, if it is dual trace, you display a known clock signal to compare with.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that many of the AVR micros have a Clock Output option, to route the clock to an I/O pin.

As a logically driven pin that is isolated from the RC and / or crystal oscillator, attaching a scope probe to this pin won't alter the clock frequency one is trying to measure.

Attaching a scope probe directly to the Xtal pins is very likely to alter the loading and the frequency.

You may have been aware of that already, but I just thought I'd mention it to make sure.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

buy a cheap Logic Analyser

Is that really the best choice for:
Quote:

audio/DSP

??

I would have thought one would want to see the humps and bumps?

A decent DSO will allow you to analyze both analog and digital activity - some even do an L/A kind off thing (like protocol analysis etc). I guess the downside of a DSO is that you may be limited to just 2 (or, if lucky, 4) channels.

Of course the first rule of any analysis equipment is that you always need one more channel that you have actually got and that's independent of how many channels the device has ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would agree that an Analog scope is best for Audio. After all, you can see the wave shape.

OTOH, the OP wants to investigate the "clock speed, timer speeds according to certain overflow values, pwm, interrupts etc"

You should definitely see the relationship between digital signals if you have more than one channel. A single channel would be morer trouble than it is worth. (except for viewing wave shape)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

(except for viewing wave shape)

...and amplitude...
...and frequency.
;-) (*)

(but I agree one or even two usually turns out to be pretty useless - sadly I own two scopes - both two channel - one completely analog and one is a storage scope from the very dawn of time - I think it stores the samples on knots tied in a piece of string or something).

(*) OK I guess "wave shape" really meant those two things.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a 30 year old 10MHz 2-channel scope. I forget when I last used it. It takes up desk space.

My Saleae Logic Analyser is used very often.

YMMV.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the advice. I'm going in to see my tutor on Friday so will ask about using the Universitys' lab scopes for analogue waveform measurement. I've been having a look at Logic analysers as suggested and as luck would have it, I have a Papilio One 500k board here at home so programmed it with GadgetFactory's OLS firmware and have been using OLS Logicsniffer Java client to measure timing signals fro arduino pins with good results! Using DDRD and PORTD to turn a pin on and off without delays I get a 1.00MHz frequency reading between on/off states and using Arduinos' pinMode and digitalWrite to do the same thing I get a frequency of 79KHz. I intend to look into timers, PWM, ADC and SPI also...