I'd be grateful if anyone can confirm whether, with the CCP module of a PIC16F818 in "special event trigger" mode, the I/O pin associated with CCP behaves as a normal digital output controlled by its PORTB bit. The simulator in MPLAB v7.21 suggests otherwise. I can demonstrate the scenario independently of my code by running manual tests on MPSIM using the SFR window. When I set TRISB to all zeroes and CCP1CON to any value from B'00001000' to B'00001111', the PORTB bit associated with the CCP module (RB2 or RB3 depending on CONFIG word) "sticks" at its previous value -- any attempts to change it by writing to PORTB have no effect. When I repeat this test with CCP1CON set to B'00000xxx', all PORTB bits can be changed freely. I'd expect the CCP output to override the state of the relevant bit in the PORTB register in the modes CCP1CON3:CCP1CON0 = 1000, 1001 and 11xx but *not* in "software interrupt on match" or "special event trigger" modes (CCP1CON3:CCP1CON0 = 1010 and 1011). The block diagram of the RB3 pin (Figure 5-11 on page 48 of the PIC16F818 data sheet) backs this up: in the latter two modes, the value on the PORTB data latch rather than the CCP output latch should appear on the output pin. I don't have a device in the PIC16F818 family to hand at the moment, so I'm unable to establish whether this is a bug in MPSIM or an oddity of the PIC16F818. I have previously used "special event trigger" mode in a PIC16F628 to configure Timer 1 and CCP1 as a 16-bit period counter with auto-reload whilst also using the RB3/CCP pin as an independent digital output. Is there a restriction on this in the PIC16F818 family? Many thanks in advance for any help. -- Ian Chapman Chapmip Technology, UK -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist