-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gotta love compilers... On SDCC 2.6.0 the following: LATC = 1 << i; Compiled to this: ; .line 32; driver.c LATC = 1 << i; MOVLW 0x01 MOVWF _LATC MOVF r0x00, W BZ _00111_DS_ NEGF WREG BCF STATUS, 0 _00112_DS_: RLCF _LATC, F ADDLW 0x01 BNC _00112_DS_ _00111_DS_: Which caused some real strangeness as the hardware connected to LATC was running at high speed and did not like getting turned on at the wrong time. I checked the headers too, and LATC is correctly declared volatile. Setting a temp variable to 1 << i, and then assigning that to LATC fixed the problem. My copy of SDCC is rather old, 2.8.0 is the current stable version, but it does show why you need to know assembly. - -- http://petertodd.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFH5CFB3bMhDbI9xWQRAo+HAJoDTJen9gox//o1eNMwuY3DEXZZGwCgqcwY jjwK3d3dS2cdkSy9vQAxKK0= =IOHG -----END PGP SIGNATURE----- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist