James Fitzsimons said: > Hi all, > I am trying to hunt down some code to drive a modified hobby servo. I have > written some code in C, however I can't seem to get accurate enough > performance out of it. I have just tried to go to the piclist website to see > if there is any code there but the site seems to be down?? Works for me... try it again. > If anyone has some code that accurately turns a pin on and off for between 1 > and 2ms and would like to share it I would be extremely grateful. > > I have a feeling that to get the accuracy I need I may need to inline some > assembler, however I have not done this before... I have done this, and it's the *only* time I have had to resort to inline assembly for precise timing. What kind of resolution do you need? I needed to move the servo in fixed 15 degree steps, so worked out the proper delay and just looped it N times. I did a servo tester/exerciser a couple of years ago in CC5X C, which I quickly abandoned for CCS. It was posted on the iversoft.com website, but that appears to be down. You can still find it at https://www.botkin.org/dale or http://www.botkin.org:8000/dale, at least until the new web server is on line and running on a real connection. Hope this helps, Dale -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics