Giter VIP home page Giter VIP logo

Comments (11)

RobTillaart avatar RobTillaart commented on June 12, 2024

thanks for reporting this issue, as I am rather busy I have little time to investigate.
might take several days

from mcp23s17.

Obili69 avatar Obili69 commented on June 12, 2024

No problem. Im currently also investigating the issue.

from mcp23s17.

RobTillaart avatar RobTillaart commented on June 12, 2024

Some questions:

  • Have you connected the line 10 to the select line of the MCP23S17?
  • if I understand it well it returns 1 even if you connect to GND?
  • there is no pull up resistor in your hardware?

from mcp23s17.

Obili69 avatar Obili69 commented on June 12, 2024

Some answers :)

  • im using pin 42 as CS
  • Yes i had now im only getting 0 even if high im not sure why it flipped
  • No its just a switch that changes from VCC to GND

CODE:

//
//    FILE: MCP23S17_digitalRead.ino
//  AUTHOR: Rob Tillaart
// PURPOSE: test MCP23S17 library
//     URL: https://github.com/RobTillaart/MCP23S17


#include "MCP23S17.h"


MCP23S17 MCP(42);
int rv = 0;


void setup()
{
  Serial.begin(115200);
  Serial.println();
  Serial.print("MCP23S17_LIB_VERSION: ");
  Serial.println(MCP23S17_LIB_VERSION);
  delay(100);

  SPI.begin(12, 11, 13, 42);

  rv = MCP.begin();
  Serial.println(rv ? "true" : "false");

  rv = MCP.pinMode8(0, 0xFF);
  Serial.println(rv);
  rv = MCP.pinMode8(1, 0x00);
  Serial.println(rv);


  Serial.print("HWSPI: ");
  Serial.println(MCP.usesHWSPI());

  Serial.println("TEST read1(pin)");
  for (int pin = 0; pin < 8; pin++)
  {
    int val = MCP.read1(pin);
    Serial.print(val);
    Serial.print(' ');
    delay(100);
  }
  Serial.println();
  MCP.write8(1, 0xFF);
}


void loop()
{
  delay(1000);
  Serial.println("TEST read1(pin)");
  for (int pin = 0; pin < 8; pin++)
  {
    int val = MCP.read1(pin);
    Serial.print(val);
    Serial.print(' ');
    delay(100);
  }
  Serial.println();

}


//  -- END OF FILE --

(added code tags)

from mcp23s17.

RobTillaart avatar RobTillaart commented on June 12, 2024

Could you run a test with software Spi ?
You should be able to use the same pins.

MCP23S17 MCP(select, datain, dataout, clock)

A thought popped up
Could it be that datain and dataout were swapped?

from mcp23s17.

Obili69 avatar Obili69 commented on June 12, 2024

Okay so i tried it with sw SPI. The Outputs are still working no reaction from the inputs. I hooked the Inputs directly to VCC testet the voltage. I have 3.3V on the PIN.

from mcp23s17.

RobTillaart avatar RobTillaart commented on June 12, 2024

Do you use this one - https://www.mikroe.com/expand-2-click (I2C)
or - https://www.mikroe.com/expand-click (SPI)

just to be sure.

from mcp23s17.

Obili69 avatar Obili69 commented on June 12, 2024

I got the Mirkoe-951
As far as i saw thats the SPI version. What i think is wierd is that the Outputs are working
BTW props for the amount of libs you crated

from mcp23s17.

Obili69 avatar Obili69 commented on June 12, 2024

News
I found a second click board and i tried that. It just works now. Thanks A lot anyway. Hope you keep up the great work. I donated you a bit. Sorry for the time waste.

from mcp23s17.

RobTillaart avatar RobTillaart commented on June 12, 2024

Sorry for the time waste.

If you learn something, time is never wasted!
Was it a different type of board, or is the first one a faulty one? just to understand the root cause.

Hope you keep up the great work, I donated you a bit.

Will do so, thank you, much appreciated!

from mcp23s17.

Obili69 avatar Obili69 commented on June 12, 2024

The board was just faulty only the port i used as a output was working i changed the port i uses as input to output and it didnt work anymore. :( Thanks have a nice day

from mcp23s17.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.