Jinx wrote: >> Actually it does not work! >> I define as recommended: >> #define lmot_dir PORTE,0 >> then code as follows: >> BCLR lmot_dir >> when I build I get the following error: >> BOT_1.s:90: Error: Too few operands ('bclr lmot_dir') >> > > Is the problem with #define or bclr ? I've not used the dsPIC so > can't help you from experience but looking at the instruction set > in the user guide, there appear to be two forms of bclr - bclr.b > and bclr.w > > bclr (with no .b or .w) is by default bclr.w. Perhaps if you try > > bclr.b lmot_dir or bcf lmot_dir > > The #define seems to work fine as far as I can tell. The compiler does not error on the define. As far as I understand the error, it suggests that lmot_dir should have an operand similar to the way BCLR PORTE,#0 describes clearing porte bit 0 with the #0 indicating the bit position. I will try your suggestion (bclr.b or bcf) to see if it works. Will post with the results in a few minutes. -- Regards, Stephen D. Barnes -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist