chipKIT® Development Platform

Inspired by Arduino™

MAX32 PORT read problem

Created Thu, 26 Feb 2015 07:39:04 +0000 by conklin003


Thu, 26 Feb 2015 07:39:04 +0000

I am using a MAX32 to readout inputs from 55 comparators for a project I am working on. The code polls the A, C, D, E, F, and G Port registers, masking off unused bits, to see if there are any inputs, like this:

while ( (PORTA&maskPORTA) + (PORTC&maskPORTC) + (PORTD&maskPORTD) + (PORTE&maskPORTE)
          + (PORTF&maskPORTF) + (PORTG&maskPORTG) == 0 ) {
    // Do Nothing 
  }  // Onl

There is a problem, however, with the PORTA read, specifically with pins 80 (Reg A6), 81 (Reg A7), 85 (Reg A9), 21 (Reg A14) and/or 20 (Reg A15). These pins seem to get "stuck" high, even when the input pin has been grounded. I have tried the code on 3 different boards all to no avail. Does anyone have any idea what might be happening here? How can these pins register as "high" when they are grounded?


Tue, 19 Jan 2016 20:33:19 +0000

Hi conklin003,

I found your post while I was looking through unanswered questions. I'm sorry you never got an answer, but I'll try to help now in case you or anybody else has this problem. Are you still having problems with this, or did you find a solution? It looks like all of the problem pins are connected to I2C related pins on the chip.