Use Arduino Uno to generate clock signal but amplitude is too low

Hi everyone,

I am using Arduino Uno to generate a 4MHz clock signal as clock input for a system I work on. But maybe because mishandling (?) the amplitude of this clock signal become very small (50mV instead of 5V). And two of my Arduino have now facing the same problem.

I don’t actually understand how what happened. My code to generate the clock signal is shown below:

pinMode(3, OUTPUT);
pinMode(SS,OUTPUT);
TCCR2A = 0x23; //registers value, tells the chip
TCCR2B = 0x09; //enable fast PWM mode
//When counter equals OCR2A, start over from 0
//When counter equals OCR2B, set pin3 to 0
//When counter equals 0, set ORC1B to 1
//Don’t scale the clock signal (keep 16 MHz)
OCR2A = 3; //The counter will start over at 3. (0,1,2,3,0…)
OCR2B = 1; //Pin3 will toggle off at 1, and toggle back on at 0

Did I burn the I/O port?

Thank you everyone for all possible inputs!

Thats not the whole code but a mere snippet.

Want to try that again please and maybe also use the code tags ( </> )

Ballscrewbob:
Thats not the whole code but a mere snippet.

Want to try that again please and maybe also use the code tags ( </> )

Thanks! I didn’t even know how to embed the code even though I looked through the text box to find it. Such a newbie :stuck_out_tongue:

</> #include <SPI.h>

</>void setup() {

I have no idea what you are doing but it doesn't appear to be working Maybe try the code thing again but save as a draft copy and check that its going to come out OK

test code

</> is some button in the advanced editor :wink:

try

type
** **[code]** **

your code here
type
** **[/code]** **

What are you driving with the clock, are you sure it has a high enough input impedance to support 5 volts. Does not sound like a software problem. Disconnect the line and see if the voltage is correct. Need to look at the signal with a scope or if it is 50% duty cycle you will get 50% on a voltmeter.

Joe

I am using Arduino Uno to generate a 4MHz clock signal as clock input for a system I work on. But maybe because mishandling (?) the amplitude of this clock signal become very small (50mV instead of 5V). And two of my Arduino have now facing the same problem.

How are you measuring the clock signal amplitude?
Did you previously read 5V and something has changed?