>-----Original Message----- >From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] >Sent: 07 December 2005 20:58 >To: piclist@mit.edu >Subject: [PIC]: CCP "special event trigger" mode on a PIC16F818 > > >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, I've been trying to simulate the CCP under MPLAB 7.21 recently, and I'm almost certain the simulator is somewhat buggy in this area. In special trigger mode, the CCP pin should be just a normal I/O pin, and certainly this is the case on the devices I've been using (18F parts). Unfortunately I don't have an PIC16F818 to test. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist