How can i use Interrupt to start ISR on PWM

Hi guys,

i am using the ( to generate a PWM signal on PIN 9. Now my question is, how i can run a ISR or specific function when the PWM level is going from HIGH to LOW. It should trigger a second pulse on Pin 10 every x cycles on PIN 9 LOW. My first attempt to output something with the example below didn't work at all :-/ At least i was able to setup up any frequency and duty cycle required.



 *  Timer1 library example
 *  June 2008 | jesse dot tane at gmail dot com

#include "TimerOne.h"

int Tastgrad;
long dutycycle;
int Frequenz;
int freq;
int Tperiod;

void setup()
  Frequenz = 300; // Frequenz in Hz
  Tastgrad = 80;  // Tastgrad in %
  dutycycle = Tastgrad * 10.24;
  freq = 500000 / Frequenz;

  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  Timer1.pwm(9, dutycycle);             

void callback()
  digitalWrite  (10,LOW);

void loop()
  // your program here...