Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[moved] Proteus bug 8.5SP0 - and pic 24fj16ga004

Status
Not open for further replies.

Seegoon

Newbie level 3
Joined
May 31, 2017
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
16
I can't get this simple program 10 lines of code to simulate correctly.
It works fine in mplab simulator. Using XC16 Ver 1.26.
Basically clearing the individual TRIS C registers and setting the appropriate latches.
At the end , doing it in 1 shot.

Is proteus really that useless?
Attached is "main.c" , Proteus project and .cof and .hex files , in a rar file

Below is the code , out of interest..
Code:
#include "xc.h"

_CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & BKBUG_OFF & ICS_PGx3 & FWDTEN_OFF & FWPSA_PR128 & WDTPS_PS256)
_CONFIG2(FNOSC_PRI & FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_HS)

int main(void)
{
    AD1PCFG = 0xFFFF;

    TRISCbits.TRISC0 = 0;
    LATCbits.LATC0 = 1;
    TRISCbits.TRISC1 = 0;
    LATCbits.LATC1 = 1;
    TRISCbits.TRISC2 = 0;
    LATCbits.LATC2 = 1;
    TRISCbits.TRISC3 = 0;
    LATCbits.LATC3 = 1;
    
    TRISC = 0;
    LATC = 0x02FF;
    while (1);

}

- - - Updated - - -

Forgot to add what Proteus does :0)
Instead of turning on latches C0 to C3 in turn Proteus does this.
START:
LATC0 =OFF
LATC1 =OFF
LATC2 =OFF
LATC3 =OFF

C0= ON
C1, C2 , C3 = OFF Correct to here :0)

C0 = OFF WRONG FROM HERE ON
C1 = ON
C2 , C3 =OFF

C0 =OFF WRONG
C1 = OFF
C2 = ON
C3 = OFF

C0 to C2 = OFF
C3 = ON

Cheers
Seegoon
 

Attachments

  • PROTEUSTEST.rar
    42.4 KB · Views: 37

What is the config value BKBUG? IF it is supposed to be DEBUG then *NEVER EVER* play with that setting - leave it to the IDE.
Susan
 

What is the config value BKBUG? IF it is supposed to be DEBUG then *NEVER EVER* play with that setting - leave it to the IDE.
Susan

It's the default value BKBUG_OFF. This equates to 0x7FFF. Interestingly BKBUG_ON is also 0x7FFF , so it obviously makes no difference what you select.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top