usually the datasheet give some example of it... sorry to sound like a broken record

Have a look to Darrel's instant interrupt code...