This invention relates to compounds that are agonists of the muscarinic M1 receptor and which are useful in the treatment of muscarinic M1 receptor mediated diseases. Also provided are pharmaceutical compositions containing the compounds and the therapeutic uses of the compounds. Compounds provided are of formula I, where n is 1 or 2; p is 0, 1 or 2; q is 0, 1 or 2; and R1-R6 are as defined herein.