chipKIT® Development Platform

Inspired by Arduino™

Change Notification Interrupt not working

Created Wed, 18 Sep 2013 18:10:23 +0000 by CB_Code


CB_Code

Wed, 18 Sep 2013 18:10:23 +0000

Hi,

I am trying with Change Notification Interrupt

I am expecting LED to be OFF when there is a interrupt but without giving a interrupt the LED is continuously blinking...

I am new to Chipkit Max32. Pls help

#include "ChangeNotification.h"
void setup()
{
Serial.begin(9600);
pinMode(PIN_LED1,OUTPUT);
pinMode(A0,INPUT);
digitalWrite(A0, HIGH);
//attachInterrupt(0, encendido, LOW);
attachInterrupt(CN_2,encendido,FALLING);


}

void loop()
{

Serial.println(digitalRead(A0));
digitalWrite(PIN_LED1,LOW);
}

void encendido()
{
digitalWrite(PIN_LED1,HIGH);
}

majenko

Thu, 19 Sep 2013 09:41:15 +0000

Unless you are using a very very very new version of the IDE (i.e., one compiled yourself from the git repo), the MAX32 board definition is lacking the information for the internal pull-up resistors.

There is an updated board definition header file in this thread: [url]http://www.chipkit.org/forum/viewtopic.php?p=9811#p9811[/url]. Either use that, or add an external pull-up resistor to +3.3V.


EmbeddedMan

Thu, 19 Sep 2013 14:11:19 +0000

I just did a build last night for Windows: [url]http://chipkit.s3.amazonaws.com/builds/mpide-0023-windows-20130918-test.zip[/url]

That should have the CN support you're looking for.

*Brian


CB_Code

Mon, 23 Sep 2013 12:26:56 +0000

Hi Brian,

I am not able to do the INTERNAL_PULLUP. I tried both new MPIDE which you have compiled and with old IDE and replacing the old Board_Data.c file. I am not able to do Internal Pullup.

Regards,

CB


majenko

Mon, 23 Sep 2013 13:06:37 +0000

Surely that should be INPUT_PULLUP not INTERNAL_PULLUP...?


CB_Code

Mon, 23 Sep 2013 14:26:14 +0000

Hi Brian,

pinMode(A0,INPUT_PULLUP);

This is not working. I mean Intenal Pullup to 3.3V, I checked on oscilloscope.

Regards,

CB