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

AD8403 Ready #15

Merged
merged 1 commit into from
Oct 12, 2022
Merged

AD8403 Ready #15

merged 1 commit into from
Oct 12, 2022

Conversation

Ale11Re
Copy link
Contributor

@Ale11Re Ale11Re commented Oct 8, 2022

changed SPI_MODE1 to SPI_MODE0
changed Reset, Shutdown logic
changed demo example

changed SPI_MODE1 to SPI_MODE0
changed Reset, Shutdown logic
changed demo example
@RobTillaart
Copy link
Owner

@Ale11Re
Thanks for the issues and the PR, I will look at them today.

@RobTillaart RobTillaart self-assigned this Oct 12, 2022
@RobTillaart RobTillaart merged commit 442873a into RobTillaart:master Oct 12, 2022
@RobTillaart
Copy link
Owner

verified the documentation and merged your code.
Thanks again, I will update the version to 0.3.0 (going to add RP2040 in build support too)

@RobTillaart
Copy link
Owner

RobTillaart commented Oct 12, 2022

@Ale11Re
Could you verify if the software SPI does works as intended (I assume you have some hardware nearby)
Thanks for your time.

This was referenced Oct 12, 2022
@Ale11Re
Copy link
Contributor Author

Ale11Re commented Oct 12, 2022

@RobTillaart Yes, I confirm it's working with software SPI too.
I have a question now: does it work with AD520X after my changes?

@RobTillaart
Copy link
Owner

Thanks for verifying.
I have to check if I have a spare to make a test setup.
Otherwise I need to order one.

Just to know, what board do you use?

@RobTillaart
Copy link
Owner

No chip available, ordered - https://nl.rs-online.com/web/p/power-motor-robotics-development-tools/2475645
(not cheap but looks easy to test)

@Ale11Re
Copy link
Contributor Author

Ale11Re commented Oct 12, 2022

I'm using an arduino mega2560. I could also verify ESP32 VSPI but not HSPI as I only have 1 model which has HSPI already in use.
I only have one AD8403 lying around.
I used an oscilloscope to verify sawtooth and sinusoidal wave and as you mentioned, software SPI is about 15 times slower than hardware SPI.
Just to clarify: this is my first contribution in github, I believe I understood how this platform works so if I made a mistake, please let me know.

@RobTillaart
Copy link
Owner

Your contribution is super 👍 really appreciated.
I have written a lot of libraries in past decade and are not able to test all possible configurations.
Some are even only tested by others

I am interested in the ESP32 VSPI and the software SPI. The latter is very fast on ESP32, in some other tests it was roughly on par with hardware SPI. The SW SPI pulses are slightly slower thus longer, but SW SPI has not the transaction overhead. In fact this results in nicer square waves with the SW SPI. It would be nice if confirmed here too.

@Ale11Re
Copy link
Contributor Author

Ale11Re commented Oct 13, 2022

So, as I'm writing, I'm testing HSPI and VSPI on ESP32 and they work as intended.
Software SPI works too but it's a bit slower:
1 tooth of the Sawtooth wave takes about 4ms on HSPI and VSPI while on Software SPI 6.5 ms.
Just for reference, it's about 5 ms long on the hardware SPI of AtMega2560 and 60ms on software SPI.

@RobTillaart
Copy link
Owner

Thanks for these numbers, they look good imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants