Cannot Get Synchronous Stimulus To Work

Discussion in 'Embedded Systems and Microcontrollers' started by jpanhalt, Mar 24, 2015.

  1. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    PIC = 12F1840
    Simulator: MPLAB SIM
    Language: MPASM
    Compiler: MPLAB 8.92

    I adapted the program presented in Completed Projects to the 12F1840 ( ).

    Both programs run fine in real life. Most important, the 12F683 program simulated just fine. That is, PIR1,CCP1IF properly detects a synchronous stimulus applied to GPIO,2

    The "same stimulus" applied to the analogous RA2 pin of the 12F1840 does not work. ADCON0 and all analog inputs on the 12F1840 have been disabled and set to digital. Since RA5 is an alternate pin for the CCP1 function and does not have ADC capability like RA2, I used the APFCON (alternate pin function control) to change the input to RA5. Also made sure the stimulus was applied to RA5 . Output screens show "stimulus applied" and no errors.

    Nevertheless, stimulus applied to either pin fails to properly set the CCP1IF flag.

    To reiterate, the same program except for changing port/pin names and disabling analog feature unique to the 12F1840 simulates fine on the 12F683.

    I checked the Microchip forums, particularly the one for MPLAB SIM, and found a few comments related to similar problems with the enhanced mid-range devices, but no resolution of them.

    Anyone have experience here?