lcgamboa / picsimlab

PICsimLab - Programmable IC Simulator Laboratory
GNU General Public License v2.0
442 stars 85 forks source link

MCP23S17 not working as inpurs #112

Closed rocksail closed 1 week ago

rocksail commented 1 month ago

Describe the bug When trying to use the MCP23S17 spare part, I set pins as inputs, but cannot make them work - when I read from them the value does not change.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Files If applicable, add a minimal source code together with a PICSimLab workspace (.pzw file) to help reproduce your problem.

Desktop (please complete the following information):

Troubleshooting: The simulation in PICSimLab consists of 3 parts:

When a problem occurs it is important to detect where it is occurring.

One of the most common problems is the error in the microcontroller program. Before creating an issue, test your code on a real circuit (even partially) to make sure the problem is not there.

Errors in the microcontroller simulation can be detected using code debugging. Any instruction execution or peripheral behavior outside the expected should be reported in the project of simulator used (picsim or simavr).

If the problem is not in either of the previous two options, the problem is probably in PICSimLab. A good practice is to send a source code together with a PICSimLab workspace (.pzw file) to open the issue about the problem.

lcgamboa commented 1 month ago

Hi @rocksail ,

Input mode is not yet implemented. I will try to add support as soon as possible. Do you have any example code for reading MCP pins that I can use for testing during development?

rocksail commented 1 month ago

Hi,

Thanks for answering - been trying to make this work for 3 weeks - tried a thousand different libraries :) Will give you a more comprehensive sketch. In the meantime, I think there is another problem - Multiple MCP23s17s can only be addressed with a unique CS and not with same CS and different HW addresses ( A0, A1, A2 ). WHen I tried to address the extenders with HW addresses, all extenders respond in the same way as the add=0 chip.

thanks

Rgds Ruben

On Wed, Jun 5, 2024 at 6:54 PM lcgamboa @.***> wrote:

Hi @rocksail https://github.com/rocksail ,

Input mode is not yet implemented https://github.com/lcgamboa/picsimlab/blob/1524251009c50c4be6204087edb384161d74b115/src/parts/other_IO_MCP23S17.cc#L395. I will try to add support as soon as possible. Do you have any example code for reading MCP pins that I can use for testing during development?

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2150529157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPORRTEXWM6XPBRX5NTZF47E7AVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJQGUZDSMJVG4 . You are receiving this because you were mentioned.Message ID: @.***>

lcgamboa commented 1 month ago

The support to address in SPI of MCP23s17 is incomplete but is simple to fix. Thank you for the return. I will put this issue on the to-do list.

rocksail commented 1 month ago

Glad to help!

On Thu, Jun 6, 2024 at 1:33 PM lcgamboa @.***> wrote:

The support to address in SPI of MCP23s17 is incomplete but is simple to fix. Thank you for the return. I will put this issue on the to-do list.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2152138434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPP3IMDLOCISZQ4R6C3ZGBCH7AVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGEZTQNBTGQ . You are receiving this because you were mentioned.Message ID: @.***>

rocksail commented 1 month ago

Just a query, I came across the picsimlab v8.(2) update that states that the spare part for MCP23017 was added, but could not find it. Was this released ? Rgds Ruben

On Thu, Jun 6, 2024 at 1:33 PM lcgamboa @.***> wrote:

The support to address in SPI of MCP23s17 is incomplete but is simple to fix. Thank you for the return. I will put this issue on the to-do list.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2152138434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPP3IMDLOCISZQ4R6C3ZGBCH7AVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGEZTQNBTGQ . You are receiving this because you were mentioned.Message ID: @.***>

lcgamboa commented 1 month ago

Hi Ruben,

the MCP23017 is partially implemented as a device (same code of 23S), but there is no part yet to MCP23017, only for MCP23S017. It's simple to be finished but will require more time to be tested.

Regards, Luis Claudio.

rocksail commented 1 month ago

Ok, thanks for the update.

On Thu, Jun 6, 2024 at 2:00 PM lcgamboa @.***> wrote:

Hi Ruben,

the MCP23017 is partially implemented as a device https://github.com/lcgamboa/picsimlab/blob/1524251009c50c4be6204087edb384161d74b115/src/devices/io_MCP23X17.cc#L228 (same code of 23S), but there is no part yet to MCP23017, only for MCP23S017. It's simple to be finished but will require more time to be tested.

Regards, Luis Claudio.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2152225681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPP2G7ST53FJ5676RTDZGBFMXAVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGIZDKNRYGE . You are receiving this because you were mentioned.Message ID: @.***>

lcgamboa commented 1 month ago

Hi @rocksail ,

I have added support to read, address, and interrupts in MCP23S17 in the latest build. I have tested with the Arduino Adafruit MCP23017 library.

rocksail commented 1 month ago

Thanks, I'll check it out!

On Sat, Jun 8, 2024 at 9:10 PM lcgamboa @.***> wrote:

Hi @rocksail https://github.com/rocksail ,

I have added support to read, address, and interrupts in MCP23S17 in the latest build https://github.com/lcgamboa/picsimlab/releases/tag/latestbuild. I have tested with the Arduino Adafruit MCP23017 library.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2156144549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPOW73WMBXS44COTWADZGNJJ3AVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE2DINJUHE . You are receiving this because you were mentioned.Message ID: @.***>

rocksail commented 1 month ago

Hi again, Looks like all is working fine now ..... wonderful ! ! ! and big thanks ! ! ! rgds Vik

On Sat, Jun 8, 2024 at 9:10 PM lcgamboa @.***> wrote:

Hi @rocksail https://github.com/rocksail ,

I have added support to read, address, and interrupts in MCP23S17 in the latest build https://github.com/lcgamboa/picsimlab/releases/tag/latestbuild. I have tested with the Arduino Adafruit MCP23017 library.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2156144549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPOW73WMBXS44COTWADZGNJJ3AVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGE2DINJUHE . You are receiving this because you were mentioned.Message ID: @.***>

rocksail commented 1 month ago

Hi again,

Sorry to bother you again. But I am trying to use the keypad spare part ( originally I was trying to use it with MCP23s17 - but then I tried to use it with arduino uno directly) but cannot make it work.

It seems that I can read the Lines but not the columns.

Is there a known issues please ?

Regds

On Thu, Jun 6, 2024 at 2:00 PM lcgamboa @.***> wrote:

Hi Ruben,

the MCP23017 is partially implemented as a device https://github.com/lcgamboa/picsimlab/blob/1524251009c50c4be6204087edb384161d74b115/src/devices/io_MCP23X17.cc#L228 (same code of 23S), but there is no part yet to MCP23017, only for MCP23S017. It's simple to be finished but will require more time to be tested.

Regards, Luis Claudio.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2152225681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPP2G7ST53FJ5676RTDZGBFMXAVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGIZDKNRYGE . You are receiving this because you were mentioned.Message ID: @.***>

rocksail commented 1 month ago

my bad .... disregard

On Tue, Jun 11, 2024 at 2:34 PM Viking Rocksailor @.***> wrote:

Hi again,

Sorry to bother you again. But I am trying to use the keypad spare part ( originally I was trying to use it with MCP23s17 - but then I tried to use it with arduino uno directly) but cannot make it work.

It seems that I can read the Lines but not the columns.

Is there a known issues please ?

Regds

On Thu, Jun 6, 2024 at 2:00 PM lcgamboa @.***> wrote:

Hi Ruben,

the MCP23017 is partially implemented as a device https://github.com/lcgamboa/picsimlab/blob/1524251009c50c4be6204087edb384161d74b115/src/devices/io_MCP23X17.cc#L228 (same code of 23S), but there is no part yet to MCP23017, only for MCP23S017. It's simple to be finished but will require more time to be tested.

Regards, Luis Claudio.

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2152225681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPP2G7ST53FJ5676RTDZGBFMXAVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGIZDKNRYGE . You are receiving this because you were mentioned.Message ID: @.***>

lcgamboa commented 1 month ago

I have added support to MCP23017 on the Latest code build.

rocksail commented 4 weeks ago

Awesome, thanks!

On Sat, Jun 15, 2024 at 6:47 PM lcgamboa @.***> wrote:

I have added support to MCP23017 on the Latest code build. https://github.com/lcgamboa/picsimlab/releases/tag/latestbuild

— Reply to this email directly, view it on GitHub https://github.com/lcgamboa/picsimlab/issues/112#issuecomment-2170303669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6LPPNAVQFEXCBZLY52J6TZHRVYPAVCNFSM6AAAAABI2UWABOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZQGMYDGNRWHE . You are receiving this because you were mentioned.Message ID: @.***>