Go Down

Topic: 48MHz == 500kHz actual clock speed (Read 955 times) previous topic - next topic

JesterJ

The specification for clock speed for the MKRZERO shows 48MHz, however if I simply toggle a pin the duration of the change is 2uS.

It feels like I have regressed to a 6800 from the 70's, what's up with this?

Code: [Select]
digitalWrite(5, HIGH);
digitalWrite(5, LOW);

MartinL

Hi JesterJ,

Direct register manipulation should work faster:

Code: [Select]
REG_PORT_OUTSET1 = PORT_PB11;  // digitalWrite(5, HIGH);
REG_PORT_OUTCLR1 = PORT_PB11;  // digitalWrite(5, LOW);

Go Up