Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Defines Not Working (Read 2332 times)
James Brown
Junior Member
**
Offline


Posts: 46
Location: Near San Diego
Joined: Jul 31st, 2012
Defines Not Working
Nov 18th, 2013 at 11:34pm
Print Post  
I am using this bit of code to understand interrupts on the tiny85.  It works fine when the attachInterrupt comments are swapped.  Both compile fine.

Why is that?
Code
Select All
volatile int count = 0;
void isrResponse()// Interrupt Service Routine (ISR)
{
	count = 1000;// Reset the counter;
}

void setup()
{
	pinMode(PB0,OUTPUT);//
	pinMode(PB3,OUTPUT);//WHT LED Interrupt felt
	//attachInterrupt (0, isrResponse, HIGH);  // Works - attach interrupt handler
	attachInterrupt (INT0, isrResponse, HIGH);  // Fails - attach interrupt handler
	count = 0;
}

void loop()
{
	if (count >10)
	{
		digitalWrite(PB3,HIGH);//Dead Man Turn on LED
		delay(1000);

		digitalWrite(PB3,LOW);//Dead Man Turn off LED
		count = 0;
	}
	digitalWrite(PB0,HIGH);  // Proof of life
	delay(500);
	digitalWrite(PB0,LOW);  // Proof of life
	delay(500);
	count ++; 
} 

  
Back to top
IP Logged
 
Jo Sto
Ex Member
*


Re: Defines Not Working
Reply #1 - Nov 19th, 2013 at 1:17pm
Print Post  
INT0 is a macro on AVR-registerlevel, for tiny it is defined in "iotnx5.h" as "#define INT0    6"

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint