well, i finally got it working. the problem was mainly the header had the wrong address for the period and duty cycle registers!!!! also, i aws misusing the dty() and per() macros (they do not do what i thought they did), so i just used the hex values for the assignment, and it works fine!