uno 2000hz to tiny 45 not the same

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bgs
 
Posts: 1
Joined: Tue Oct 20, 2015 3:48 am

uno 2000hz to tiny 45 not the same

Post by bgs »

Hi All
i need to create a 2000Hz square wave on a tiny. i do most on the UNO and get close with the blink default and
do the following:
int val = 244; //=1993/ 244= 2006
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delayMicroseconds(val); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delayMicroseconds(val); // wait for a second

changing pin 13 to o for the tiny using same code the first tiny is 241hz the second is at 239hz and so on

I have to have a better control over the accuracy as the tolerance needed is about 1 hz

the tiny45 is at 1MHz and are all different.

What am i doing different / wrong?
any help would be great
bgs

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”