Pages: [1]   Go Down
Author Topic: Reading the clock on an Uno  (Read 1117 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm new to Arduino, and logic analyzers.  I have an Uno and a Saleae Logic.  I can run the blink program and see the signal on pin 13 that cycles the LED.  But I'd like to see it in relation to the clock.  I've searched around, and though that the clock pin on the Uno is 7, but there is no signal on that pin.

So how do I read the clock signal too?

Thanks.
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Easy answer: you can't.

Difficult answer: program the 'clock output' FUSE and grab the signal on the 'CLKO' pin (see the datasheet).

I also wonder how accurate that will be. Sampling a 16MHz signal with a logic analyzer that can only do 24Ms/s.
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino has no build in clock, you could program a timer to give a pulse on a pin or do it manually

try this (not tested)
Code:
void setup()
{
  pinMode(13, OUTPUT);
  pinMode(7, OUTPUT);
}

int state = HIGH;

void loop()
{
  if (state == HIGH)
  {
    state = LOW;
  }
  else
  {
    state = HIGH;
  }
  digitalWrite(7, state);
  digitalWrite(13, state);
  delay(100);
}
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the responses.

So I basically can only measure pins relative to each other, not to a baseline.  At least I know I wasn't missing something.
Logged

Pages: [1]   Go Up
Jump to: