LEDs blink by themselves on PIC32-PINGUINO-MICRO

Started by wimp#1, March 19, 2013, 04:01:19 PM

Previous topic - Next topic

wimp#1

Hello, All.

I have trouble with RE0..RE5 on my PIC32-PINGUINO-MICRO. I set them to output, light some LEDs on them, and the LEDs start blinking individually by themselves!

Here is my sample code. I have cut-andpasted in some code from the Microchip manual "Section 13. Parallel Master Port (PMP)", since I realized it is a Parallel Master Port, but it still blinks.

Any suggestions as to make them not blink?   The LEDs are connected through resistors to +3V.

Best regards
wimpy

const int RELAY1 = 29;   //RE0  //
const int RELAY2 = 27;   //RE1
const int RELAY3 = 26;   //RE2
const int RELAY4 = 25;   //RE3
const int RELAY5 = 24;   //RE4
const int RELAY6 = 23;   //RE5



void setup() {
    // put your setup code here, to run once:
       IEC1CLR = 0x000000000004;
       PMMODE =  0x000000000000;
    PMCON =      0x0000000000000000;
    PMAEN =      0x0000000000000000;
    PMCONSET = 0x0000;
    IFS1CLR = 0x0004;

   
    pinMode(RELAY1, OUTPUT);
    pinMode(RELAY2, OUTPUT);
    pinMode(RELAY3, OUTPUT);
    pinMode(RELAY4, OUTPUT);
    pinMode(RELAY5, OUTPUT);
    pinMode(RELAY6, OUTPUT);


digitalWrite(RELAY1,LOW);
digitalWrite(RELAY2,LOW);
digitalWrite(RELAY3,LOW);
digitalWrite(RELAY4,LOW);
digitalWrite(RELAY5,LOW);
digitalWrite(RELAY6,LOW);

    }

void loop() {
    // put your main code here, to run repeatedly:

    }
Windows, Icons, Mice and Pointers

LubOlimex

Hey wimp#1,

What LEDs are you using? Maybe you should try with smaller LEDs.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex