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.

Proteus simulation working but lots of simulation messages

Status
Not open for further replies.

lloydi12345

Member level 4
Joined
Aug 31, 2010
Messages
77
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Activity points
1,953
Hi, I'm using C18 and everything works fine. Compilation succeeded. But the problem is I'm encountering thousands of warning messages on Proteus. Here's the same warning message:

Code:
PIC18 EXEC) PC=0x0032. Attempt to execute illegal opcode (loaded from PC=0030). Instruction executes as a NOP.

Here's my code:

Code:
#include <p18f4620.h>
#include <delays.h>

#pragma config OSC = XT
#pragma config LVP = OFF
#pragma config WDT = OFF

int counter = 0;
int enabler = 1;
int enabling = 1;
int timing = 0;

#pragma interrupt maketime
void maketime(void)
{
	PIR1bits.TMR1IF = 0;
	timing++;
	if (timing == 5){
		PORTEbits.RE0 = ~PORTEbits.RE0;
		timing = 0;
	}
	if (counter > 9){
		counter = 0;
	}
}

void numberselector(unsigned int SevenSegInput)
{
	switch(SevenSegInput){
	case 1: LATC = 0xF9; break;
	case 2: LATC = 0xA4; break;
	case 3: LATC = 0xB0; break;
	case 4: LATC = 0x99; break;
	case 5: LATC = 0x92; break;
	case 6: LATC = 0x82; break;
	case 7: LATC = 0xF8; break;
	case 8: LATC = 0x80; break;
	case 9: LATC = 0x98; break;
	case 0: LATC = 0xC0; break;
	
	}
}

void main()
{
	PORTA = 0x00;
	PORTB = 0x00;
	PORTC = 0x00;
	PORTD = 0x00;
	PORTE = 0x00;

	LATA = 0x00;
	LATB = 0x00;
	LATC = 0x00;
	LATD = 0x00;
	LATE = 0x00;

	TRISA = 0xFF;
	TRISB = 0x00;
	TRISC = 0x00;
	TRISD = 0x00;
	TRISE = 0x00;	

	ADCON1 = 0x0F; //all I/O are digital

	T1CONbits.RD16 = 1;
	T1CONbits.T1RUN = 0;
	T1CONbits.T1CKPS1 = 0;
	T1CONbits.T1CKPS0 = 0;
	T1CONbits.T1OSCEN = 0;
	T1CONbits.TMR1CS = 0;
	T1CONbits.TMR1ON = 1;

	PIE1bits.TMR1IE = 1;
	IPR1bits.TMR1IP = 1;

	INTCONbits.GIE = 1;
	INTCONbits.PEIE = 1;

	TMR1H = 0x00;
	TMR1L = 0x00;

	LATC = 0xC0;

	while(1)
	{
		numberselector(counter);
	}
}

Hoping for usual quick replies. Thanks :)
 

Attachments

  • error.JPG
    error.JPG
    406.8 KB · Views: 104

are you sure you are simulating the same pic in proteus????

any way it seems an clasical "invalid extended instruction set" maybe in C18 or in proteus it has the Extended instruction set mis-enabled i suggest to disable in code, in options and in proteus...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top