Hi,
I am trying to to read the pulses from a receiver for a remote control car with a Attiny45 using the 8MHz internal oscillator I've successfully read the pulses with my UNO; however, when i try to read the pulses with the attiny it wont register any pulses lower than about 1500 (1.5ms). Is 8MHz to slow to catch the shorter pulses or could it be some other issue? Im using the high low tech core for the attiny45.
As far as I recall, I've yet to have any issues receiving iR remote signals using ATTiny85 (similar, just more RAM) at 8MHz using the arduino-tiny core linked in the previous post.
Below is the output from my Attiny85 @ 8MHZ, connected to a rc receiver
Pulses from 1101 - 1923 as expected.
This also shows how convenient it is to use Coding Badly's TinyISP. You can get debuginformation in serial monitor, just like you are used to from the Arduino
I tried to install the cores that coding badly posted however I believe i'm missing something in the installation because i cant even get the attiny to blink an led now.
And the following folder should contain the Arduino-Tiny core...
C:\Projects\Arduino\hardware\tiny\cores\tiny\
Open the "boards.txt" file and change both of the "upload.using" entries to
the appropriate value for your setup. Following from the examples above, the
file would be here...
C:\Projects\Arduino\hardware\tiny\boards.txt
what dose it want me to put in place of the "upload.using" in the bord.txt file?
Iam not getting any errors it uploads to the chip without any errors but i cant even get a simple sketch like blinking an led to work on it. Im pretty sure i have the core instillation wrong. I put the tiny and tolls folder into the hardware folder an that's really it from the read me instructions i sounds like i have to do something else but i find the instructions vauge.
I have re-installed the high low tech cores and am back to where i started. i can get it to read pulses above about 1500 but not lower. Is there any way it could be something rather than the core? Im trying to get it to work on my attiny44 8Mhz but have the same result. could the pin im using to read the rc signal be the problem?
Ok not really sure why the other code didn't work but i got it to work with the below code all i did diffrent was set the other pin high (for testing i used a common anode RGB led). thanks everyone that tired to help.
int rc = 5;
int sp = 0;
int g = 7;
int b = 6;
void setup(){
pinMode(rc,INPUT);
pinMode(b,OUTPUT);
pinMode(g,OUTPUT);
}
void loop(){
sp = pulseIn(rc,HIGH);
if (sp <1400&& sp >500){//reverse
digitalWrite(b,LOW);
digitalWrite(g,HIGH);
delay(10);
}
if( sp >1500){//forward
digitalWrite(g,LOW);
digitalWrite(b,HIGH);
delay(10);
}
else{//neutral and failsafe
digitalWrite(b,HIGH);
digitalWrite(g,HIGH);
}
}