So I'm trying to run a simply sketch on an atiny85
I am able to program the board correctly
the function I'm having difficulty with is delayMiroseconds
Im running the 85 in 8MHZ mode on 1.6.7
Im trying to get a certain frequency of digital oscillation.
38khz
The period in seconds obviously being 0.0000263
divide that by 2 to get the appropriate delay roughly 13 microseconds should get me close
When i put the chip on the scope with nothing connected to output pin 0 except the scope probe the square wave looks terrible with very large rising edge peaks. its also showing about 3khz not 38khz like it should me
Can anyone help me figure out why the delayMicrosecond function is not working properly? I was told it works just fine on a tiny85 and accurately when running the chip at 8mhz internal clock
It should be noted that i have also tried running the atiny85 in both 1meg and 8 meg mode. Seems to just split the output frequency in half
There are many threads about this working down to about 3 microseconds so i should be ok at 13
all I'm using is the blink example with the delayMicro for testing
I am able to program the board correctly
the function I'm having difficulty with is delayMiroseconds
Im running the 85 in 8MHZ mode on 1.6.7
Im trying to get a certain frequency of digital oscillation.
38khz
The period in seconds obviously being 0.0000263
divide that by 2 to get the appropriate delay roughly 13 microseconds should get me close
When i put the chip on the scope with nothing connected to output pin 0 except the scope probe the square wave looks terrible with very large rising edge peaks. its also showing about 3khz not 38khz like it should me
Can anyone help me figure out why the delayMicrosecond function is not working properly? I was told it works just fine on a tiny85 and accurately when running the chip at 8mhz internal clock
It should be noted that i have also tried running the atiny85 in both 1meg and 8 meg mode. Seems to just split the output frequency in half
There are many threads about this working down to about 3 microseconds so i should be ok at 13
all I'm using is the blink example with the delayMicro for testing
Code:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://arduino.cc
This example code is in the public domain.
modified 8 May 2014
by Scott Fitzgerald
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(0, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
delayMicroseconds(13); // wait for a second
digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
delayMicroseconds(13); // wait for a second
}