Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Cannot Simulate Synchronous Stimulus with 12F1840

Status
Not open for further replies.

jpanhalt

Well-Known Member
Most Helpful Member
PIC = 12F1840
Simulator: MPLAB SIM
Language: MPASM
Compiler: MPLAB 8.92

I have a program that uses CCP and TMR1 to measure a PWM signal. I have attached the code.

The original program was for a 12F683. That was adapted to the 12F1840. Both programs run fine in real life. Most important, the 12F683 program simulates 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. 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. One comment suggested setting ADCON0 to 0xFF instead of clearing it. Tried that, no effect.
Since RA5 is an alternate pin for the CCP1 function and does not have ADC capability like RA2 does, I used APFCON (alternate pin function control) to change the input to RA5. Also made sure the stimulus was applied to RA5 . That didn't fix the problem either.

Output screens show "stimulus applied" and no errors.

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

Anyone have experience here?

John
 

Attachments

  • AMS_5048A_PWM_12F1840_ver 1.1.0 clean..asm
    13.8 KB · Views: 186
jpanhalt.

Do u have a schematic for the circuit? I can do the sim in ISIS (with a schema)and verify what I see.
I have encountered provable sim errors where spec sheet says set this bit for this result and i have had to clr the bit. Trying a different sim might sort it out.
 
Status
Not open for further replies.

Latest threads

Back
Top