Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve performance 16 pins interface #24

Merged
merged 3 commits into from
Aug 17, 2023
Merged

improve performance 16 pins interface #24

merged 3 commits into from
Aug 17, 2023

Conversation

RobTillaart
Copy link
Owner

No description provided.

@RobTillaart RobTillaart self-assigned this Aug 15, 2023
@RobTillaart RobTillaart added the enhancement New feature or request label Aug 15, 2023
@RobTillaart RobTillaart changed the title improve performance 16 bit interface improve performance 16 pins interface Aug 15, 2023
@alx-uta
Copy link
Contributor

alx-uta commented Aug 15, 2023

@RobTillaart just had a look at the code.

I can see what you did, instead of reading or writing twice, you'll only do it once.

That's really good.

I'll run a few tests and I'll share the results.

@alx-uta
Copy link
Contributor

alx-uta commented Aug 15, 2023

Test results:

Software SPI

true
HWSPI: 0

SPISpeed:	1000000

time in microseconds

TEST digitalWrite(0, value):	63.38
TEST digitalWrite(pin, value):	45.69
TEST digitalRead(pin):	32.00

TEST write8(port, mask):	33.00
TEST read8(port):	34.50

TEST write16(mask):	39.50
TEST read16():	39.50

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	2000000

time in microseconds

TEST digitalWrite(0, value):	60.88
TEST digitalWrite(pin, value):	61.06
TEST digitalRead(pin):	31.62

TEST write8(port, mask):	32.00
TEST read8(port):	31.50

TEST write16(mask):	31.50
TEST read16():	31.50

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	4000000

time in microseconds

TEST digitalWrite(0, value):	60.88
TEST digitalWrite(pin, value):	61.06
TEST digitalRead(pin):	31.62

TEST write8(port, mask):	32.00
TEST read8(port):	31.50

TEST write16(mask):	31.50
TEST read16():	31.50

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	8000000

time in microseconds

TEST digitalWrite(0, value):	60.88
TEST digitalWrite(pin, value):	61.06
TEST digitalRead(pin):	31.62

TEST write8(port, mask):	32.00
TEST read8(port):	31.50

TEST write16(mask):	31.50
TEST read16():	31.50

VAL1:	0
VAL8:	170
VAL16:	43690

Hardware SPI:

true
HWSPI: 1

SPISpeed:	1000000

time in microseconds

TEST digitalWrite(0, value):	85.87
TEST digitalWrite(pin, value):	62.94
TEST digitalRead(pin):	43.94

TEST write8(port, mask):	45.00
TEST read8(port):	47.00

TEST write16(mask):	45.00
TEST read16():	45.00

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	2000000

time in microseconds

TEST digitalWrite(0, value):	56.31
TEST digitalWrite(pin, value):	56.31
TEST digitalRead(pin):	29.12

TEST write8(port, mask):	29.50
TEST read8(port):	29.50

TEST write16(mask):	23.50
TEST read16():	23.50

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	4000000

time in microseconds

TEST digitalWrite(0, value):	42.63
TEST digitalWrite(pin, value):	42.63
TEST digitalRead(pin):	22.19

TEST write8(port, mask):	22.50
TEST read8(port):	22.50

TEST write16(mask):	16.50
TEST read16():	16.50

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	8000000

time in microseconds

TEST digitalWrite(0, value):	35.63
TEST digitalWrite(pin, value):	35.63
TEST digitalRead(pin):	18.56

TEST write8(port, mask):	19.00
TEST read8(port):	19.00

TEST write16(mask):	13.00
TEST read16():	13.00

VAL1:	0
VAL8:	170
VAL16:	43690

SPISpeed:	10000000

time in microseconds

TEST digitalWrite(0, value):	34.31
TEST digitalWrite(pin, value):	34.31
TEST digitalRead(pin):	17.87

TEST write8(port, mask):	18.00
TEST read8(port):	18.00

TEST write16(mask):	12.00
TEST read16():	12.00

VAL1:	0
VAL8:	170
VAL16:	43690

done...

It looks really good, thx for updating it! :)

@RobTillaart RobTillaart merged commit 351991f into master Aug 17, 2023
5 checks passed
@RobTillaart RobTillaart deleted the develop branch August 17, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants