SNL-WaterPower / siweed

Sandia Interactive Wave Energy Education Display (SIWEED)
5 stars 2 forks source link

Added encoder buffer library #28

Closed DeepFriedDerp closed 4 years ago

DeepFriedDerp commented 4 years ago

Added the base library files (two header files, and one source file) complete with very basic doxygen documentation and the corresponding html/LaTeX output files (see html/index.html, majority of documentation located under "classes"). Also included is a documented example file to show basic functionality, with pin maps for both the MEGA and Due, as well as spi_DUE.jpg image for help with the Due SPI hookups. The code has been tested on both the MEGA and the Due (SPI clock frequencies up to 8MHz on the Mega and 4MHz on the Due). This library still needs to be tested with a working encoder.

related to #14

nickross4444 commented 4 years ago

We'll test it next time we're in the lab.

nickross4444 commented 4 years ago

Some notes after looking more into it and lab testing: (@DeepFriedDerp or I will take care of these) -LM3766 in some of the documentation/header files needs to change to LS7366. -MDR0 settings arround line 87 need to look like this: unsigned char MDR0_settings = MDRO_x1Quad | MDRO_freeRunningCountMode | MDRO_indexDisable | MDRO_syncIndex | MDRO_filterClkDivFactor_1;

With those setting changes it seems to work properly.

nickross4444 commented 4 years ago

Correction, to maintain 3200 counts per revolution, the MDRO_x1Quad parameter above should instead be MDRO_x4Quad