You need to log in to create posts and topics.

SimulIDE 1.1.0 Program Counter crash, 8051

PreviousPage 2 of 2

Hmmm, you are right. In a bare file without any of the 'unused' code, it now works again. Somehow my other code which is never executed, stops it.

I put, the interrupt routine back in.

unsigned short duty_on = 0;
unsigned short duty_off = 0;

unsigned int timer1_of = 0;
unsigned long count_result = 0;
volatile char counting = 0;

void timer0_isr(void) __interrupt(TF0_VECTOR) {
	// Stop timers
	TR0 = 0; TR1 = 0;
	// Calculate result of timer 1
	count_result = ((unsigned long)TL1) + (((unsigned long)TH1) << 8);
	count_result += ((unsigned long)timer1_of) * ((unsigned long)65536);
	counting = 0;
}

Even though theoretically it would never run? Somehow it stops everything running.

 

Appears having the line count_result = ((unsigned long)TL1) + (((unsigned long)TH1) << 8);

somehow crashes it

PreviousPage 2 of 2