Skip to content

Commit

Permalink
optimize 16 bit interface (#44)
Browse files Browse the repository at this point in the history
- #43 optimize read/write16, kudos to Olkal
- add performance test output 0.5.2, 0.5.3
- add datasheet REV C and REV D to repo
  • Loading branch information
RobTillaart authored Jun 12, 2024
1 parent 7de0753 commit 62893f6
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.5.3] - 2024-06-12
- #43 optimize read/write16, kudos to Olkal
- add performance test output 0.5.2, 0.5.3
- add datasheet REV C and REV D to repo

## [0.5.2] - 2024-05-19
- Fix #40, add several interrupt functions (experimental)
- update **MCP23S17_registers.h** (reuse with MCP23017)
Expand Down
2 changes: 1 addition & 1 deletion MCP23S17.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: MCP23S17.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.5.2
// VERSION: 0.5.3
// PURPOSE: Arduino library for SPI MCP23S17 16 channel port expander
// DATE: 2021-12-30
// URL: https://github.com/RobTillaart/MCP23S17
Expand Down
4 changes: 2 additions & 2 deletions MCP23S17.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: MCP23S17.h
// AUTHOR: Rob Tillaart
// VERSION: 0.5.2
// VERSION: 0.5.3
// PURPOSE: Arduino library for SPI MCP23S17 16 channel port expander
// DATE: 2021-12-30
// URL: https://github.com/RobTillaart/MCP23S17
Expand All @@ -13,7 +13,7 @@
#include "MCP23x17_registers.h"


#define MCP23S17_LIB_VERSION (F("0.5.2"))
#define MCP23S17_LIB_VERSION (F("0.5.3"))

// ERROR CODES
#define MCP23S17_OK 0x00
Expand Down
Binary file added documents/MCP23017_REV_D.pdf
Binary file not shown.
Binary file added documents/MCP23x17_REV_C.pdf
Binary file not shown.
26 changes: 26 additions & 0 deletions examples/MCP23S17_performance/performance_0.5.2.UNO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@


# Performance test

Test sketch MCP23S17_performance.ino

Max clock frequency 8 MHz, Arduino UNO, IDE 1.8.19

### Library version: 0.5.2

| Action | SW SPI | HW 1 MHz | HW 2 MHz | HW 4 MHz | HW 8 MHz | HW 10 MHz | notes |
|:------------------------------|--------:|---------:|---------:|---------:|---------:|:---------:|:---------:|
| TEST digitalWrite(0, value) | 677.25 | 65.75 | 48.25 | 39.25 | 34.25 | n.a. |
| TEST digitalWrite(pin, value) | 678.75 | 67.25 | 49.50 | 40.25 | 35.25 | n.a. |
| TEST digitalRead(pin) | 452.00 | 44.50 | 32.00 | 26.25 | 23.50 | n.a. |
| | | | | | | |
| TEST write8(port, mask) | 450.00 | 44.00 | 32.00 | 26.00 | 24.00 | n.a. |
| TEST read8(port) | 452.00 | 46.00 | 30.00 | 24.00 | 24.00 | n.a. |
| TEST write16(mask) | 450.00 | 42.00 | 28.00 | 22.00 | 20.00 | n.a. | since 0.1.1
| TEST read16() | 446.00 | 42.00 | 30.00 | 24.00 | 20.00 | n.a. | since 0.1.1


### Notes



24 changes: 24 additions & 0 deletions examples/MCP23S17_performance/performance_0.5.3.UNO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@


# Performance test

Test sketch MCP23S17_performance.ino

Max clock frequency 8 MHz, Arduino UNO, IDE 1.8.19

### Library version: 0.5.3

| Action | SW SPI | HW 1 MHz | HW 2 MHz | HW 4 MHz | HW 8 MHz | HW 10 MHz | notes |
|:------------------------------|--------:|---------:|---------:|---------:|---------:|:---------:|:---------:|
| TEST digitalWrite(0, value) | 677.25 | 65.75 | 48.25 | 39.25 | 34.25 | n.a. |
| TEST digitalWrite(pin, value) | 678.75 | 67.25 | 49.50 | 40.25 | 35.25 | n.a. |
| TEST digitalRead(pin) | 452.00 | 44.50 | 32.00 | 26.25 | 23.50 | n.a. |
| | | | | | | |
| TEST write8(port, mask) | 450.00 | 44.00 | 32.00 | 26.00 | 24.00 | n.a. |
| TEST read8(port) | 452.00 | 46.00 | 30.00 | 24.00 | 24.00 | n.a. |
| TEST write16(mask) | 300.00 | 26.00 | 18.00 | 16.00 | 14.00 | n.a. | since 0.1.1
| TEST read16() | 298.00 | 28.00 | 18.00 | 16.00 | 14.00 | n.a. | since 0.1.1


### Notes

2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/MCP23S17.git"
},
"version": "0.5.2",
"version": "0.5.3",
"license": "MIT",
"frameworks": "*",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MCP23S17
version=0.5.2
version=0.5.3
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for SPI MCP23S17 16 channel port expander 16 IO-lines
Expand Down

0 comments on commit 62893f6

Please sign in to comment.