Code not working on ATtiny45?

I wrote this code to make an adapter for an aeroplane ESC to work with a pistol grip radio. It reads the signal coming from the Rx and remaps it to appropriate signal values before sending it to the ESC.
I got the code to successfully work on an ATmega8, now I’m trying to get it to run on an ATtiny45 using the Servo8Bit library, but it doesn’t seem work. I tried SoftwareServo library, but I get too many errors on that.

I could upload the sketch on to the Tiny45 without any errors using the Servo8Bit library, the ESC starts up with all the normal beeps, but when I increase throttle on the radio, nothing happens, the motor doesn’t run. My guess is, the pulseIn () isn’t working right.
Any alternatives?

#include <Servo8Bit.h>    
Servo8Bit esc;            
unsigned long Rxpulse;        
void setup()
  pinMode (6, INPUT);  
  esc.attach (9);   
void loop()
  Rxpulse = pulseIn(6,HIGH);    
  Rxpulse = constrain(Rxpulse, 1426, 1720);    
  unsigned long escPulse = map(Rxpulse, 1426, 1720, 819, 1720);  
  const unsigned long MIN_INPUT_LENGTH = 1426;    

The Attiny defaults to 1MHz. Perhaps your code assumes it’s working at 8Mhz. I think you have to do some extra step at upload time to make it operate at 8MHz.


Noob here. more info on make the code run at 8MHz?
The Tiny45 fuses are set to run at 8MHz, though.

How did you upload your code to the ATTiny? You need to select the right board / frequency in the Tools->Board menu, before you upload. In your case it should be something like "ATTiny45 (internal 8 MHz clock)”.

Also, the SoftwareServo library should work, if your ATTiny is set up correctly. You need to do the following change to get it working with the Arduino version 1.0.1 and above:

Open the file “SoftwareServo.h” from the library folder and change:

#include <WProgram.h>


#include "Arduino.h"

Check the pin numbering

pinMode (6, INPUT);  
  esc.attach (9);

Pin 6 and 9 does not exist on a tiny45