diff --git a/docs/assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.jpg b/docs/assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.jpg new file mode 100644 index 0000000..1261f89 Binary files /dev/null and b/docs/assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.jpg differ diff --git a/docs/assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.png b/docs/assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.png new file mode 100644 index 0000000..69d7101 Binary files /dev/null and b/docs/assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.png differ diff --git a/docs/changelog.md b/docs/changelog.md index 0ab2c9e..523d65e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1104,4 +1104,168 @@ Changelog updated 2019-10-30_18-51-54 - Merge pull request #59, implement "fast" pin operations [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bcc7b254848091533b7deb3d211f6bcc399fe6ba) +------------------------------------ +### v2.1.5 to v2.1.6 + +Changelog updated 2019-12-28_03-43-10 + + *Added Features* + +- Adds support for inverting trigger logic. [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5b8c409c109954ea520e5c1e6de9c1f0834889c2) + + +------------------------------------ + + *Bugfixes* + +- Fixed width of thermals on singledisk adapter [view commit](http://github.com/pyr0ball/pyr0piezo/commit/024c6f79111242985d1ce0a0b3ad4358f0d885bf) + +- Fixed pad thermals, added url, fixed logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/041836b40b0e0d6fce617c9f73365e8ca9ecb076) + +- Fix for gain adjustment [view commit](http://github.com/pyr0ball/pyr0piezo/commit/94e2c127951575f3847e72235969a1623eac13a4) + +- fixing serial input not taking effect immediately [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4076423e1babf8e6e45f1878481dfe42f29fe211) + + +------------------------------------ + + *Documentation Updates* + +- Documentation update for v2.1.5 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72861a36e1e76c1264d3bc8b02479edc6d3979) + + +------------------------------------ + + *Full Changelog* + +- Documentation update for v2.1.5 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72861a36e1e76c1264d3bc8b02479edc6d3979) + +- These code changes are for resetting the config values to the default values by issuing the ERASE word via a serial terminal. [view commit](http://github.com/pyr0ball/pyr0piezo/commit/106e6c85c3c5f97e20d947a8b6ea3a6f8f30a268) + +- Merge pull request #60 from klcjr89/master [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9ae410f011c43e5bf4ccb902ef1734d0a61edb28) + +- Fixed width of thermals on singledisk adapter [view commit](http://github.com/pyr0ball/pyr0piezo/commit/024c6f79111242985d1ce0a0b3ad4358f0d885bf) + +- Fixed pad thermals, added url, fixed logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/041836b40b0e0d6fce617c9f73365e8ca9ecb076) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/cd3503beb31c346c0f0f1a1cc53c6ba1a06c57a3) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/64550544467b6e2e5627938338ac63c5a39c5b9b) + +- removed file that shouldn't be tracked [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4f3558b79198da40932a678d410cca57b1e0d801) + +- slight edit to platformio.ini, added dependencies [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bc2de746b469d2f04452b55baafd523cc7e335da) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/407c9834d1c8e9db58041ba84cbe5064d64e20d8) + +- Adds support for inverting trigger logic. [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5b8c409c109954ea520e5c1e6de9c1f0834889c2) + +- ignore [view commit](http://github.com/pyr0ball/pyr0piezo/commit/0d73cc55ef50b1bd11193d47e42e2f0afad97601) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e0ebe53efcb320a8ba2d552461838486075b0d3b) + +- Fix for gain adjustment [view commit](http://github.com/pyr0ball/pyr0piezo/commit/94e2c127951575f3847e72235969a1623eac13a4) + +- Merge branch 'develop' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/75776942085c672776ceaa32988dce46d45389a2) + +- Merge pull request #63 from loredan/master [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ecd472d80f0a7a46bc7a6d5eddbbe107c6ed22ed) + +- Merge branch 'develop' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d30c60639c6a0f82697a97257e89b2291526aa0e) + +- fixing serial input not taking effect immediately [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4076423e1babf8e6e45f1878481dfe42f29fe211) + +- fixed accidental reversal of gain adjust #oops [view commit](http://github.com/pyr0ball/pyr0piezo/commit/3dcadb5e4ee9449eafdcd9f9861ba8b142373eb1) + +- Revert "fixed accidental reversal of gain adjust #oops" [view commit](http://github.com/pyr0ball/pyr0piezo/commit/2e4cf0ce58e460622cf5e639a15f78481c319839) + + +------------------------------------ +### v2.2.0 to v2.2.1 + +Changelog updated 2020-01-16_11-24-38 + + *Added Features* + +- modified i2c registermap, added stubs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/44bd9f0182551668aaab3dc2de385f5a79deab13) + +- added firmware version to serial response [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a3e4ec86a50ed991f97b5f85aabd0a15fd036d81) + +- Changed default state of I2C input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/217c13b82700d58774b874f0865f5ca04f3cc418) + +- changed error LED behavor to instead indicate a trigger event [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a1267204d5403a3fcd20f680be75cc6753366ca9) + + +------------------------------------ + + *Bugfixes* + +- fixed platformio.ini to allow build and upload directly [view commit](http://github.com/pyr0ball/pyr0piezo/commit/79f0d657dae01ad02d266a6bccb526845505fa5f) + +- fixed logic and pzdet inputs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c30905bd74cbeee65109ae18643ec04123abecbd) + +- fixed logic level change not taking effect til trigger [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a9d928833ae6d14214eb6c7c8d67bd5974ad9e74) + +- changed compiler to include help message only on 328pb [view commit](http://github.com/pyr0ball/pyr0piezo/commit/49bfe7663be0cf019b0fa1aa846345dbcf57a6e5) + +- fixed missing semicolon [view commit](http://github.com/pyr0ball/pyr0piezo/commit/568dc93311a8d3494a61e922cccb929b97420f75) + + +------------------------------------ + + *Documentation Updates* + +- Updated changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/30999ed4a85cdaa3950d054585f2e8e1aa40b08a) + +- added instructions for PZDET and LOGIC to main.cpp [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e668988f3e19932119ac72bfea4e37bb68af4197) + +- added docs for wiring up UART and uploading firmware [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7d352360d959c2db4ea76a79ba3f1acb30223905) + +- fixed typo in link to uart pdf [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5e82dc5cd52ab07667528740195c2beb0991256a) + +- fixed another typo in docs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/85b63734d758edf3e3b1204091920ffe8ed0068f) + +- Added wiring image for ezpz uart [view commit](http://github.com/pyr0ball/pyr0piezo/commit/882a8721f0f0c8cd4eefa72273038afe15239471) + + +------------------------------------ + + *Full Changelog* + +- Updated changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/30999ed4a85cdaa3950d054585f2e8e1aa40b08a) + +- fixed platformio.ini to allow build and upload directly [view commit](http://github.com/pyr0ball/pyr0piezo/commit/79f0d657dae01ad02d266a6bccb526845505fa5f) + +- removed bad merge lines [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d903a8a4f371f1ab5a2dbd87b2ae19bf4c0ac080) + +- fixed logic and pzdet inputs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c30905bd74cbeee65109ae18643ec04123abecbd) + +- added instructions for PZDET and LOGIC to main.cpp [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e668988f3e19932119ac72bfea4e37bb68af4197) + +- fixed logic level change not taking effect til trigger [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a9d928833ae6d14214eb6c7c8d67bd5974ad9e74) + +- changed compiler to include help message only on 328pb [view commit](http://github.com/pyr0ball/pyr0piezo/commit/49bfe7663be0cf019b0fa1aa846345dbcf57a6e5) + +- fixed missing semicolon [view commit](http://github.com/pyr0ball/pyr0piezo/commit/568dc93311a8d3494a61e922cccb929b97420f75) + +- added verbose output to PIO build flags [view commit](http://github.com/pyr0ball/pyr0piezo/commit/539e5d141125f04c009c2347d187fdfc84b5c451) + +- modified i2c registermap, added stubs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/44bd9f0182551668aaab3dc2de385f5a79deab13) + +- added docs for wiring up UART and uploading firmware [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7d352360d959c2db4ea76a79ba3f1acb30223905) + +- fixed typo in link to uart pdf [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5e82dc5cd52ab07667528740195c2beb0991256a) + +- fixed another typo in docs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/85b63734d758edf3e3b1204091920ffe8ed0068f) + +- Added wiring image for ezpz uart [view commit](http://github.com/pyr0ball/pyr0piezo/commit/882a8721f0f0c8cd4eefa72273038afe15239471) + +- added firmware version to serial response [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a3e4ec86a50ed991f97b5f85aabd0a15fd036d81) + +- changed default state for i2c input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/904d6af9dc3e74aeae190cde418338f80e906e84) + +- Changed default state of I2C input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/217c13b82700d58774b874f0865f5ca04f3cc418) + +- changed error LED behavor to instead indicate a trigger event [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a1267204d5403a3fcd20f680be75cc6753366ca9) + + ------------------------------------ diff --git a/docs/changelogs/changelog_2019-12-28_v2.1.5_v2.1.6.md b/docs/changelogs/changelog_2019-12-28_v2.1.5_v2.1.6.md new file mode 100644 index 0000000..771e628 --- /dev/null +++ b/docs/changelogs/changelog_2019-12-28_v2.1.5_v2.1.6.md @@ -0,0 +1,71 @@ +###Pyr0-Piezo Changelog v2.1.5 to v2.1.6 + +#### Added Features + +- Adds support for inverting trigger logic. [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5b8c409c109954ea520e5c1e6de9c1f0834889c2) + + +------------------------------------ + +#### Bugfixes + +- Fixed width of thermals on singledisk adapter [view commit](http://github.com/pyr0ball/pyr0piezo/commit/024c6f79111242985d1ce0a0b3ad4358f0d885bf) + +- Fixed pad thermals, added url, fixed logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/041836b40b0e0d6fce617c9f73365e8ca9ecb076) + +- Fix for gain adjustment [view commit](http://github.com/pyr0ball/pyr0piezo/commit/94e2c127951575f3847e72235969a1623eac13a4) + +- fixing serial input not taking effect immediately [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4076423e1babf8e6e45f1878481dfe42f29fe211) + + +------------------------------------ + +#### Documentation Updates + +- Documentation update for v2.1.5 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72861a36e1e76c1264d3bc8b02479edc6d3979) + + +------------------------------------ + +#### Full Changelog + +- Documentation update for v2.1.5 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72861a36e1e76c1264d3bc8b02479edc6d3979) + +- These code changes are for resetting the config values to the default values by issuing the ERASE word via a serial terminal. [view commit](http://github.com/pyr0ball/pyr0piezo/commit/106e6c85c3c5f97e20d947a8b6ea3a6f8f30a268) + +- Merge pull request #60 from klcjr89/master [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9ae410f011c43e5bf4ccb902ef1734d0a61edb28) + +- Fixed width of thermals on singledisk adapter [view commit](http://github.com/pyr0ball/pyr0piezo/commit/024c6f79111242985d1ce0a0b3ad4358f0d885bf) + +- Fixed pad thermals, added url, fixed logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/041836b40b0e0d6fce617c9f73365e8ca9ecb076) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/cd3503beb31c346c0f0f1a1cc53c6ba1a06c57a3) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/64550544467b6e2e5627938338ac63c5a39c5b9b) + +- removed file that shouldn't be tracked [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4f3558b79198da40932a678d410cca57b1e0d801) + +- slight edit to platformio.ini, added dependencies [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bc2de746b469d2f04452b55baafd523cc7e335da) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/407c9834d1c8e9db58041ba84cbe5064d64e20d8) + +- Adds support for inverting trigger logic. [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5b8c409c109954ea520e5c1e6de9c1f0834889c2) + +- ignore [view commit](http://github.com/pyr0ball/pyr0piezo/commit/0d73cc55ef50b1bd11193d47e42e2f0afad97601) + +- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e0ebe53efcb320a8ba2d552461838486075b0d3b) + +- Fix for gain adjustment [view commit](http://github.com/pyr0ball/pyr0piezo/commit/94e2c127951575f3847e72235969a1623eac13a4) + +- Merge branch 'develop' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/75776942085c672776ceaa32988dce46d45389a2) + +- Merge pull request #63 from loredan/master [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ecd472d80f0a7a46bc7a6d5eddbbe107c6ed22ed) + +- Merge branch 'develop' of https://github.com/pyr0ball/pyr0piezo into develop [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d30c60639c6a0f82697a97257e89b2291526aa0e) + +- fixing serial input not taking effect immediately [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4076423e1babf8e6e45f1878481dfe42f29fe211) + +- fixed accidental reversal of gain adjust #oops [view commit](http://github.com/pyr0ball/pyr0piezo/commit/3dcadb5e4ee9449eafdcd9f9861ba8b142373eb1) + +- Revert "fixed accidental reversal of gain adjust #oops" [view commit](http://github.com/pyr0ball/pyr0piezo/commit/2e4cf0ce58e460622cf5e639a15f78481c319839) + diff --git a/docs/changelogs/changelog_2020-01-16_v2.2.0_v2.2.1.md b/docs/changelogs/changelog_2020-01-16_v2.2.0_v2.2.1.md new file mode 100644 index 0000000..705654a --- /dev/null +++ b/docs/changelogs/changelog_2020-01-16_v2.2.0_v2.2.1.md @@ -0,0 +1,87 @@ +###Pyr0-Piezo Changelog beta-avr-v2.2.0 to beta-avr-v2.2.1 + +#### Added Features + +- modified i2c registermap, added stubs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/44bd9f0182551668aaab3dc2de385f5a79deab13) + +- added firmware version to serial response [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a3e4ec86a50ed991f97b5f85aabd0a15fd036d81) + +- changed default state for i2c input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/904d6af9dc3e74aeae190cde418338f80e906e84) + +- Changed default state of I2C input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/217c13b82700d58774b874f0865f5ca04f3cc418) + +- changed error LED behavor to instead indicate a trigger event [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a1267204d5403a3fcd20f680be75cc6753366ca9) + + +------------------------------------ + +#### Bugfixes + +- fixed platformio.ini to allow build and upload directly [view commit](http://github.com/pyr0ball/pyr0piezo/commit/79f0d657dae01ad02d266a6bccb526845505fa5f) + +- fixed logic and pzdet inputs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c30905bd74cbeee65109ae18643ec04123abecbd) + +- fixed logic level change not taking effect til trigger [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a9d928833ae6d14214eb6c7c8d67bd5974ad9e74) + +- changed compiler to include help message only on 328pb [view commit](http://github.com/pyr0ball/pyr0piezo/commit/49bfe7663be0cf019b0fa1aa846345dbcf57a6e5) + +- fixed missing semicolon [view commit](http://github.com/pyr0ball/pyr0piezo/commit/568dc93311a8d3494a61e922cccb929b97420f75) + + +------------------------------------ + +#### Documentation Updates + +- Updated changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/30999ed4a85cdaa3950d054585f2e8e1aa40b08a) + +- added instructions for PZDET and LOGIC to main.cpp [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e668988f3e19932119ac72bfea4e37bb68af4197) + +- added docs for wiring up UART and uploading firmware [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7d352360d959c2db4ea76a79ba3f1acb30223905) + +- fixed typo in link to uart pdf [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5e82dc5cd52ab07667528740195c2beb0991256a) + +- fixed another typo in docs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/85b63734d758edf3e3b1204091920ffe8ed0068f) + +- Added wiring image for ezpz uart [view commit](http://github.com/pyr0ball/pyr0piezo/commit/882a8721f0f0c8cd4eefa72273038afe15239471) + + +------------------------------------ + +#### Full Changelog + +- Updated changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/30999ed4a85cdaa3950d054585f2e8e1aa40b08a) + +- fixed platformio.ini to allow build and upload directly [view commit](http://github.com/pyr0ball/pyr0piezo/commit/79f0d657dae01ad02d266a6bccb526845505fa5f) + +- removed bad merge lines [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d903a8a4f371f1ab5a2dbd87b2ae19bf4c0ac080) + +- fixed logic and pzdet inputs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c30905bd74cbeee65109ae18643ec04123abecbd) + +- added instructions for PZDET and LOGIC to main.cpp [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e668988f3e19932119ac72bfea4e37bb68af4197) + +- fixed logic level change not taking effect til trigger [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a9d928833ae6d14214eb6c7c8d67bd5974ad9e74) + +- changed compiler to include help message only on 328pb [view commit](http://github.com/pyr0ball/pyr0piezo/commit/49bfe7663be0cf019b0fa1aa846345dbcf57a6e5) + +- fixed missing semicolon [view commit](http://github.com/pyr0ball/pyr0piezo/commit/568dc93311a8d3494a61e922cccb929b97420f75) + +- added verbose output to PIO build flags [view commit](http://github.com/pyr0ball/pyr0piezo/commit/539e5d141125f04c009c2347d187fdfc84b5c451) + +- modified i2c registermap, added stubs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/44bd9f0182551668aaab3dc2de385f5a79deab13) + +- added docs for wiring up UART and uploading firmware [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7d352360d959c2db4ea76a79ba3f1acb30223905) + +- fixed typo in link to uart pdf [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5e82dc5cd52ab07667528740195c2beb0991256a) + +- fixed another typo in docs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/85b63734d758edf3e3b1204091920ffe8ed0068f) + +- Added wiring image for ezpz uart [view commit](http://github.com/pyr0ball/pyr0piezo/commit/882a8721f0f0c8cd4eefa72273038afe15239471) + +- added firmware version to serial response [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a3e4ec86a50ed991f97b5f85aabd0a15fd036d81) + +- changed default state for i2c input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/904d6af9dc3e74aeae190cde418338f80e906e84) + +- Changed default state of I2C input macro to enabled [view commit](http://github.com/pyr0ball/pyr0piezo/commit/217c13b82700d58774b874f0865f5ca04f3cc418) + +- changed error LED behavor to instead indicate a trigger event [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a1267204d5403a3fcd20f680be75cc6753366ca9) + diff --git a/docs/schematics/other/USB-UART-Wiring-Example.pdf b/docs/schematics/other/USB-UART-Wiring-Example.pdf new file mode 100644 index 0000000..737afae Binary files /dev/null and b/docs/schematics/other/USB-UART-Wiring-Example.pdf differ diff --git a/docs/schematics/other/uart-programmer-wiring.md b/docs/schematics/other/uart-programmer-wiring.md new file mode 100644 index 0000000..5521587 --- /dev/null +++ b/docs/schematics/other/uart-programmer-wiring.md @@ -0,0 +1,7 @@ +![](../../../assets/images/board-images/easy-piezi/pp-v2.1.2-uart-wiring.png) + + + +

This browser does not support PDFs. Please download the PDF to view it: Download PDF.

+ +
\ No newline at end of file diff --git a/docs/tutorials/firmware-update/beta-unit-firmware-update.md b/docs/tutorials/firmware-update/beta-unit-firmware-update.md new file mode 100644 index 0000000..03d602c --- /dev/null +++ b/docs/tutorials/firmware-update/beta-unit-firmware-update.md @@ -0,0 +1,65 @@ +# Pyr0-piezo Beta Unit Firmware Update + +The firmware for this project can be updated using one of three methods, VS Code, Arduino IDE, or avrdude. + +Please be sure you've already [wired up your sensor's UART port](../../schematics/other/uart-programmer-wiring.md) + +## VS Code (Preferred Application) + +### Installing dependencies + +1. Install [VS Code from Micosoft's official page](https://code.visualstudio.com/download) +2. Use the "Extensions" menu to install PlatformIO. +3. (Optional) Install extra plugins to assist in development: + - GitLense + - markdownlint + - Markdown Preview Enhanced + - C/C++ + - C++ Intellisense + +### Configuration + +1. In PIO Home, open the firmware folder: + - `~/pyr0piezo/firmware/AVR-Source/Pyr0_Piezo_sensor_v2.x.x` +2. Make certain you're on the latest `develop` branch + - In GitLense, under the "Repositories" menu, expand the "Branches" menu + - Right click on `develop` and select "Switch to Branch" + - Back at the top of the "Repositories" menu, hover the mouse over `Pyr0_Piezo_Sensor_v2.x.x` and click first on `fetch`, then on `pull` + +### Upload + +1. Make any desired adjustments to default values in `src/pP_config.h` +2. Click the "PlatformIO: Upload" button found in the bottom bar of the VS Code window +3. Verify Serial connection by opening the Serial Monitor and typing `CONFIG` or `STATE`. You should get a response. + +## Arduino IDE + +1. Install [Arduino IDE from Arduino's official page](https://www.arduino.cc/en/main/software) +2. Under File > Preferences > Additional Board Manager URL's, Add: + - `https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json` + +## avrdude + +#### Windows + +1. Install a bash-like terminal. Choose from a number of options: + - [Windows Subsystem for Linux] + - [CygWin] + - [Mingw64] + - [Git Bash (Comes bundled with git)] +2. Download the [avrdude binaries] +3. Extract the binaries somewhere your terminal can find them + +#### Linux + +##### Ubuntu/Debian Distro's + +```bash +sudo apt update && sudo apt install -y avrdude +``` + +##### Fedora/RHEL/CentOS Distros + +```bash +sudo yum install -y avrdude +``` diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/platformio.ini b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/platformio.ini index 715165e..a77335c 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/platformio.ini +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/platformio.ini @@ -11,12 +11,31 @@ [platformio] default_envs = ATmega328PB +[env:ICSP_Bootloader] +platform = atmelavr +framework = arduino +upload_protocol = stk500v1 +; each flag in a new line +upload_flags = + -P$UPLOAD_PORT + -b$UPLOAD_SPEED + +board_build.f_cpu = 8000000L +board_hardware.oscillator = internal +board_hardware.uart = uart0 +board_hardware.bod = 1.8v +board_hardware.eesave = yes + [env:ATmega88P] platform = atmelavr board = ATmega88P framework = arduino lib_deps = Arduino -upload_protocol = stk500v1 + +build_flags = !python version_git.py +; --verbose + +upload_protocol = arduino ; each flag in a new line upload_flags = -P$UPLOAD_PORT @@ -28,24 +47,31 @@ upload_flags = upload_speed = 38400 board_build.f_cpu = 8000000L -board_fuses.lfuse = "0xE2" -board_fuses.hfuse = "0xDF" -board_fuses.efuse = "0xF9" +board_hardware.oscillator = internal +board_hardware.uart = uart0 +board_hardware.bod = 1.8v +board_hardware.eesave = yes [env:ATmega328PB] platform = atmelavr board = ATmega328PB framework = arduino lib_deps = Arduino -upload_protocol = stk500v1 + +build_flags = !python version_git.py +; --verbose + +upload_protocol = arduino ; each flag in a new line upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED - -fmax_errors=5 ; edit these lines -;upload_port = COM4 upload_speed = 38400 -board_build.f_cpu = 8000000L \ No newline at end of file +board_build.f_cpu = 8000000L +board_hardware.oscillator = internal +board_hardware.uart = uart0 +board_hardware.bod = 1.8v +board_hardware.eesave = yes \ No newline at end of file diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp index 26bddca..6eae9d1 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/Pyr0_Piezo_Sensor_V2.x.x.cpp @@ -34,7 +34,9 @@ To set the below parameters using serial input, use the following: To change trigger active duration: TRG_D [integer for milliseconds] To change gain factor: GAIN_F [integer for gain state - see note*] -To change ADC hysteresis value: HYST [integer] +To change the output logic: LOGIC [0|1] (0 for active low, 1 for active high) +To enable piezo plugged detection: PZDET [0|1] (0 for disabled, 1 for enabled) +To change ADC hysteresis value: HYST [integer in millivolts] To change sensor input pullup vRef low threshold: VFOL [integer in millivolts] To change comparator trigger high threshold: VCOMP [integer in millivolts] To change the duration between ADC measurements: LOOP_D [integer in milliseconds] @@ -45,7 +47,7 @@ You can also enable or disable DEBUG output with: DEBUG [0|1] You can query the current configuration with: CONFIG You can query the current state (including ADC measurements) with: STATE -To reset all settings to defaults, use: RESET +To set all settings to defaults, use: ERASE These commands should be wrapped in this format: CMD INT @@ -97,7 +99,7 @@ update the voltMeterConstant variable in pP_config.h with the correct value #include "pP_serial.h" // i2c input toggle. Uncomment to enable -//#define I2C_INPUT true +#define I2C_INPUT void setup() { //Setup PWM on voltage follower (PD3) @@ -112,6 +114,7 @@ void setup() { pinMode(TRG_OUT, OUTPUT); // declare the Trigger as as OUTPUT pinMode(ERR_LED, OUTPUT); + pinMode(PZDET_PIN, INPUT_PULLUP); pinMode(Z_TRG, INPUT_PULLUP); // declare z-sense input with pullup pinMode(V_FOLLOW_PIN, INPUT); pinMode(VCOMP_SENSE_PIN, INPUT); @@ -128,6 +131,8 @@ void setup() { restoreConfig(); adjustGain(); + + digitalWriteFast(TRG_OUT, !LOGIC); } /*------------------------------------------------*/ @@ -139,7 +144,7 @@ void loop() { if (BlinkCount > 0) { BlinkState = !BlinkState; digitalWriteFast(ERR_LED, BlinkState); - digitalWriteFast(TRG_OUT, BlinkState); + //digitalWriteFast(TRG_OUT, BlinkState); --BlinkCount; } @@ -171,15 +176,20 @@ void loop() { ERR_STATE = 0; } + // Check that the piezo disk is properly connected + pzConCheck(); + // Blink LED's on init if (BlinkCount > 0) { BlinkState = !BlinkState; digitalWriteFast(ERR_LED, BlinkState); - digitalWriteFast(TRG_OUT, BlinkState); +// digitalWriteFast(TRG_OUT, BlinkState); --BlinkCount; - } else { +// } else { // Check for error state - checkError(); +// checkError(); + } else { + digitalWriteFast(ERR_LED, 0); } // Print state if debug is on diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp index 4c38f21..7c74583 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.cpp @@ -7,90 +7,8 @@ int compThrs = COMP_THRESHOLD_DEFAULT; int LOOP_DUR = LOOP_DUR_DEFAULT; // duration of time between ADC checks and other loop functions int TRG_DUR = TRG_DUR_DEFAULT; // duration of the Z-axis pulse sent, in ms int Hyst = HYST_DEFAULT; // Hysteresis value for ADC measurements +int LOGIC = LOGIC_DEFAULT; // Trigger output logic (active low or active high) +int PZDET = PZDET_DEFAULT; // Enable/disable piezo connection detection int Debug = 0; long voltMeterConstant = VM_CONST_DEFAULT; uint8_t pP_i2c_address = 0xa0; - -void resetEEPROM() { - - resetConfig(); - - EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR); - EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs); - EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs); - EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR); - EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR); - EEPROM.put(HYST_ADDRESS, Hyst); - EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant); -} - -// Restore config from EEPROM, otherwise reset config and write to EEPROM -void restoreConfig() { - int temp; - - bool reset = false; - - EEPROM.get(GAIN_FACTOR_ADDRESS, temp); - if (temp < 0 || temp > 4) { - reset = true; - } else { - GAIN_FACTOR = temp; - } - - EEPROM.get(FOLLOWER_THRESHOLD_ADDRESS, temp); - if (temp < 0 || temp > 5000) { - reset = true; - } else { - followerThrs = temp; - } - - EEPROM.get(COMP_THRESHOLD_ADDRESS, temp); - if (temp < 0 || temp > 5000) { - reset = true; - } else { - compThrs = temp; - } - - EEPROM.get(LOOP_DUR_ADDRESS, temp); - if (temp < 0 && temp > 1000) { - reset = true; - } else { - LOOP_DUR = temp; - } - - EEPROM.get(TRG_DUR_ADDRESS, temp); - if (temp < 0 || temp > 1000) { - reset = true; - } else { - TRG_DUR = temp; - } - - EEPROM.get(HYST_ADDRESS, temp); - if (temp < 0 || temp > 1000) { - reset = true; - } else { - Hyst = temp; - } - - long longTemp; - EEPROM.get(VM_CONST_ADDRESS, longTemp); - if (longTemp < 1000000L || longTemp > 1200000L) { - reset = true; - } else { - voltMeterConstant = longTemp; - } - - if (reset) { - resetEEPROM(); - } -} - -void resetConfig() { - GAIN_FACTOR = GAIN_FACTOR_DEFAULT; - followerThrs = FOLLOWER_THRESHOLD_DEFAULT; - compThrs = COMP_THRESHOLD_DEFAULT; - LOOP_DUR = LOOP_DUR_DEFAULT; - TRG_DUR = TRG_DUR_DEFAULT; - Hyst = HYST_DEFAULT; - voltMeterConstant = VM_CONST_DEFAULT; -} diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h index b5d57f1..abe8a97 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_config.h @@ -43,8 +43,20 @@ extern int Hyst; // Hysteresis value for ADC measurements #endif +#define LOGIC_DEFAULT 1 +#define LOGIC_ADDRESS 32 +#if !(defined(LOGIC)) + extern int LOGIC; // Trigger logic scheme, Active LOW is default +#endif + +#define PZDET_DEFAULT 0 +#define PZDET_ADDRESS 26 +#if !(defined(PZDET)) + extern int PZDET; // Enable or disable piezo connection detection, default is off +#endif + #if !(defined(Debug)) - extern int Debug; + extern int Debug; #endif #define VM_CONST_ADDRESS 28 @@ -58,10 +70,10 @@ #if !(defined(pP_i2c_address)) extern uint8_t pP_i2c_address; // I2C Bus Address #endif -#endif +#endif // I2C_INPUT -void resetEEPROM(); -void resetConfig(); +void eraseEEPROM(); +void setDefaultConfig(); void restoreConfig(); -#endif +#endif // PP_CONFIG_H diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.h index 4395428..d721f33 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_function.h @@ -3,6 +3,9 @@ Created by Alan "pyr0ball" Weinstock 6/26/2019 */ +//#pragma once +//#include "pP_function.h" + void digitalWriteFast(uint8_t pin, uint8_t x) { if (pin / 8) { // pin >= 8 PORTB ^= (-x ^ PORTB) & (1 << (pin % 8)); @@ -22,12 +25,19 @@ int inline analogReadFast(byte ADCpin) /*------------------------------------------------*/ +void doubleFlash() { + BlinkCount = 4 ; +} + +/*------------------------------------------------*/ + void pulse() { - digitalWriteFast(TRG_OUT, LOW); + digitalWriteFast(TRG_OUT, LOGIC); sensorHReading = 1; delay(TRG_DUR); - digitalWriteFast(TRG_OUT, HIGH); + digitalWriteFast(TRG_OUT, !LOGIC); Serial.println("Trig'd!"); + doubleFlash(); } /*------------------------------------------------*/ @@ -95,6 +105,9 @@ update the voltMeterConstant variable in pP_config.h with the correct value /* Compares diffs of threshold vs read value if positive, adjusts the follower to within the range set above*/ + followerLong = followerThrs * 1023L; + followerInt = (long long) followerLong / Vin; + followerInt = (int) followerInt; ADJ_FOLLOW = (followerInt / 4); // Analog output (PWM) of duty cycle @@ -104,6 +117,9 @@ update the voltMeterConstant variable in pP_config.h with the correct value /*------------------------------------------------*/ void adjustComp() { + compLong = compThrs * 1023L; + compInt = (long long) compLong / Vin; + compInt = (int) compInt; OCR1A = compInt; } @@ -119,46 +135,167 @@ void calibrateAlert() { /*------------------------------------------------*/ void adjustGain() { - - if (GAIN_FACTOR == 0) { - pinMode(GADJ_R3, INPUT); - pinMode(GADJ_R2, INPUT); + switch (GAIN_FACTOR) + { + case 4: + pinMode(GADJ_R0, OUTPUT); + digitalWriteFast(GADJ_R0, LOW); + break; + case 3: + pinMode(GADJ_R1, OUTPUT); + digitalWriteFast(GADJ_R1, LOW); + pinMode(GADJ_R0, INPUT); + break; + case 2: + pinMode(GADJ_R2, OUTPUT); + digitalWriteFast(GADJ_R2, LOW); pinMode(GADJ_R1, INPUT); pinMode(GADJ_R0, INPUT); - } - else if (GAIN_FACTOR > 0) { + break; + case 1: pinMode(GADJ_R3, OUTPUT); digitalWriteFast(GADJ_R3, LOW); pinMode(GADJ_R2, INPUT); pinMode(GADJ_R1, INPUT); pinMode(GADJ_R0, INPUT); - } - else if (GAIN_FACTOR > 1) { - pinMode(GADJ_R2, OUTPUT); - digitalWriteFast(GADJ_R2, LOW); + break; + case 0: + default: + pinMode(GADJ_R3, INPUT); + pinMode(GADJ_R2, INPUT); pinMode(GADJ_R1, INPUT); pinMode(GADJ_R0, INPUT); - } - else if (GAIN_FACTOR > 2) { - pinMode(GADJ_R1, OUTPUT); - digitalWriteFast(GADJ_R1, LOW); - pinMode(GADJ_R0, INPUT); - } - else if (GAIN_FACTOR > 3) { - pinMode(GADJ_R0, OUTPUT); - digitalWriteFast(GADJ_R0, LOW); + break; } } /*------------------------------------------------*/ -void checkError () { - if (ERR_STATE == 1) { - digitalWriteFast(ERR_LED, BlinkState); - BlinkState = !BlinkState; - } - else if (ERR_STATE == 0) { - BlinkState = LOW; - digitalWriteFast(ERR_LED, BlinkState); +//void checkError () { +// if (ERR_STATE == 1) { +// digitalWriteFast(ERR_LED, BlinkState); +// BlinkState = !BlinkState; +// } +// else if (ERR_STATE == 0) { +// BlinkState = LOW; +// digitalWriteFast(ERR_LED, BlinkState); +// } +//} + +/*------------------------------------------------*/ + +void pzConCheck () { + PZ_STATE = digitalRead(PZDET_PIN); + if (PZ_STATE == PZDET) { + //digitalWriteFast(TRG_OUT, LOGIC); + ERR_STATE = 1; } } + +/*------------------------------------------------*/ +void eraseEEPROM() { + + setDefaultConfig(); + + EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR); + EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs); + EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs); + EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR); + EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR); + EEPROM.put(HYST_ADDRESS, Hyst); + EEPROM.put(PZDET_ADDRESS, PZDET); + EEPROM.put(LOGIC_ADDRESS, LOGIC); + EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant); +} + +// Restore config from EEPROM, otherwise erase config and write to EEPROM +void restoreConfig() { + int temp; + + bool erase = false; + + EEPROM.get(GAIN_FACTOR_ADDRESS, temp); + if (temp < 0 || temp > 4) { + erase = true; + } else { + GAIN_FACTOR = temp; + } + + EEPROM.get(FOLLOWER_THRESHOLD_ADDRESS, temp); + if (temp < 0 || temp > 5000) { + erase = true; + } else { + followerThrs = temp; + } + + EEPROM.get(COMP_THRESHOLD_ADDRESS, temp); + if (temp < 0 || temp > 5000) { + erase = true; + } else { + compThrs = temp; + } + + EEPROM.get(LOOP_DUR_ADDRESS, temp); + if (temp < 0 && temp > 1000) { + erase = true; + } else { + LOOP_DUR = temp; + } + + EEPROM.get(TRG_DUR_ADDRESS, temp); + if (temp < 0 || temp > 1000) { + erase = true; + } else { + TRG_DUR = temp; + } + + EEPROM.get(HYST_ADDRESS, temp); + if (temp < 0 || temp > 1000) { + erase = true; + } else { + Hyst = temp; + } + + EEPROM.get(PZDET_ADDRESS, temp); + if (temp < 0 || temp > 1) { + erase = true; + } else { + PZDET = temp; + } + + EEPROM.get(LOGIC_ADDRESS, temp); + if (temp < 0 || temp > 1) { + erase = true; + } else { + LOGIC = temp; + } + + long longTemp; + EEPROM.get(VM_CONST_ADDRESS, longTemp); + if (longTemp < 1000000L || longTemp > 1200000L) { + erase = true; + } else { + voltMeterConstant = longTemp; + } + + if (erase) { + eraseEEPROM(); + } + + adjustFollow(); + adjustComp(); +} + +void setDefaultConfig() { + GAIN_FACTOR = GAIN_FACTOR_DEFAULT; + followerThrs = FOLLOWER_THRESHOLD_DEFAULT; + compThrs = COMP_THRESHOLD_DEFAULT; + LOOP_DUR = LOOP_DUR_DEFAULT; + TRG_DUR = TRG_DUR_DEFAULT; + Hyst = HYST_DEFAULT; + PZDET = PZDET_DEFAULT; + LOGIC = LOGIC_DEFAULT; + voltMeterConstant = VM_CONST_DEFAULT; + adjustFollow(); + adjustComp(); +} diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp index 057449d..fc23912 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.cpp @@ -5,23 +5,59 @@ #include "pP_i2c.h" #include +byte registerMap[regMapSize]; +byte registerMapTemp[regMapSize - 1]; +byte receivedCommands[maxBytes]; + pP_i2c::pP_i2c(){ } void pP_i2c::init() { Wire.begin(pP_i2c_address); + Wire.onRequest(i2cReply); + Wire.onReceive(i2cInput); +} + +void pP_i2c::i2cReportStatus() { + _i2cResponse = "{" +} + +void pP_i2c::i2cReportVersion() { + +} + +void pP_i2c::i2cReportConfig() { + +} + +void pP_i2c::i2cReportIdentity() { + +} + +void pP_i2c::i2cRequestInput() { + +} + +void pP_i2c::i2cReply() { + Wire.send() } void pP_i2c::i2cInput(int bytesReceived) { for (int a = 0; a < bytesReceived; a++) { - if (a < maxBytes) { - cmdRcvd[a] = Wire.read(); + // Check length of message, drops anything longer than [longBytes] + if (a <= maxBytes) { + cmdRcvd[a] = Wire.receive(); + } + elif (a <= longBytes) { + longRcvd[a] = Wire.receive(); } else { - longRcvd[a] = Wire.read(); + Wire.receive(); // } } + + // Check input command corresponds with register map, set 0x00 if not if (bytesReceived == 1 && (cmdRcvd[0] < regMapSize)) { return; } @@ -29,35 +65,65 @@ void pP_i2c::i2cInput(int bytesReceived) { cmdRcvd[0] = 0x00; return; } + + // Parse commands and apply changes or actions switch (cmdRcvd[0]) { case 0x00: - followerInt = (long) cmdRcvd[1]; + i2cReportStatus(); return; break; case 0x01: - compInt = (long) cmdRcvd[1]; + followerInt = (int) cmdRcvd[1]; return; break; case 0x02: - GAIN_FACTOR = (uint8_t) cmdRcvd[1]; + compInt = (int) cmdRcvd[1]; return; break; case 0x03: - Hyst = (uint8_t) cmdRcvd[1]; + GAIN_FACTOR = (int) cmdRcvd[1]; return; break; case 0x04: - LOOP_DUR = (uint8_t) cmdRcvd[1]; + Hyst = (int) cmdRcvd[1]; return; break; case 0x05: - TRG_DUR = (uint8_t) cmdRcvd[1]; + LOOP_DUR = (int) cmdRcvd[1]; return; break; case 0x06: + LOGIC = (int) cmdRcvd[1]; + return; + break; + case 0x07: + PZDET = (int) cmdRcvd[1]; + return; + break; + case 0x08: + TRG_DUR = (int) cmdRcvd[1]; + return; + break; + case 0x09: + DEBUG = (int) cmdRcvd[1]; + return; + break; + case 0x0a: voltMeterConstant = longRcvd[0]*65536+longRcvd[1]*256+longRcvd[2]; return; break; + case 0x0b: + reportVersion(); + return; + break; + case 0x0c: + reportConfig(); + return; + break; + case 0x0d: + reportIdentity(); + return; + break; default: return; } diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.h index 6e49724..a21df47 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_i2c.h @@ -2,18 +2,24 @@ #define _pP_i2c_h_ #ifdef I2C_INPUT - -#define senseInt_Offset 0x00 // Integer of sense threshold in millivolts -#define compInt_Offset 0x01 // Integer of comparator threshold in millivolts -#define gainFactor_Offset 0x02 // Gain adjustment factor. 0=3x, 1=3.5x, 2=4.33x, 3=6x, 4=11x -#define hysteresis_Offset 0x03 // Hysteresis value for ADC measurements -#define loopDuration_Offset 0x04 // duration of time between ADC checks and other loop functions -#define triggerDuration_Offset 0x05 // duration of the Z-axis pulse sent, in ms -#define voltMeterLong_Offset 0x06 // For fine-tuning the input volt master +#define status_Offset 0x00 // Status register +#define senseInt_Offset 0x01 // Integer of sense threshold in millivolts +#define compInt_Offset 0x02 // Integer of comparator threshold in millivolts +#define gainFactor_Offset 0x03 // Gain adjustment factor. 0=3x, 1=3.5x, 2=4.33x, 3=6x, 4=11x +#define hysteresis_Offset 0x04 // Hysteresis value for ADC measurements +#define loopDuration_Offset 0x05 // duration of time between ADC checks and other loop functions +#define logicLevel_Offset 0x06 +#define piezoDetect_Offset 0x07 +#define triggerDuration_Offset 0x08 // duration of the Z-axis pulse sent, in ms +#define debugEnable_Offset 0x09 +#define voltMeterLong_Offset 0x0a // For fine-tuning the input volt master +#define versionRegister_Offset 0x0b +#define configRegister_Offset 0x0c +#define identRegister_Offset 0x0d /*-------------------------Variables------------------------*/ -#define regMapSize 7 -uint8_t maxBytes = 2; +#define regMapSize 14 +#define maxBytes 2 #define longBytes 4 byte regMap[regMapSize]; byte regMapTemp[regMapSize]; @@ -26,10 +32,11 @@ byte longRcvd[longBytes]; class pP_i2c { public: pP_i2c(uint8_t address=pP_i2c_address); - void init(); void i2cInput(int bytesReceived); + private: + char _i2cResponse; }; -#endif -#endif +#endif // I2C_INPUT +#endif // _pP_i2c_h_ diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h index 6de03c2..bd103cb 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_pins.h @@ -29,4 +29,5 @@ Default pins (based on Rev.2.x.xPCB layout) #define GADJ_R2 5 // " #define GADJ_R3 6 // " #define V_FOL_PWM 3 // PWM analog output pin for voltage follower adjustment -#define VCOMP_PWM 9 // PWM analog output pin for comparator adjustment \ No newline at end of file +#define VCOMP_PWM 9 // PWM analog output pin for comparator adjustment +#define PZDET_PIN 16 // Digital input pin for detecting piezo connection \ No newline at end of file diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h index d5c6ab2..63af5e5 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h @@ -16,7 +16,9 @@ void parseData() { void identifyMarkers() { char x = Serial.read(); -// char y = Wire.read(); + #ifdef I2C_INPUT + char y = Wire.read(); + #endif // I2C_INPUT if (x == '\n' || x == '\r') { serialIncoming = true; @@ -32,25 +34,18 @@ void identifyMarkers() { } #ifdef I2C_INPUT - if (y == endMarker) { - readInProgress = false; + if (y == '\n' || y == '\r') { serialIncoming = true; inputBuffer[bytesRecvd] = 0; parseData(); - } - - if (readInProgress) { + bytesRecvd = 0; + } else { inputBuffer[bytesRecvd] = y; bytesRecvd++; if (bytesRecvd == buffSize) { - bytesRecvd = buffSize - 1; + bytesRecvd = buffSize - 1; } } - - if (y == startMarker) { - bytesRecvd = 0; - readInProgress = true; - } #endif } @@ -110,6 +105,23 @@ void updateHysteresis() { } /*------------------------------------------------*/ +void updateLogic() { + if (serialLong >= 0) { + LOGIC = serialLong; + EEPROM.put(LOGIC_ADDRESS, LOGIC); + pulse(); + } +} +/*------------------------------------------------*/ + +void updatePzDet() { + if (serialLong >= 0) { + PZDET = serialLong; + EEPROM.put(PZDET_ADDRESS, PZDET); + } +} +/*------------------------------------------------*/ + void updateConstant() { if (serialLong >= 0) { voltMeterConstant = (long) serialLong; @@ -168,8 +180,17 @@ void serialPrintConfig() { Serial.print("HYST "); Serial.println(Hyst); + Serial.print("LOGIC "); + Serial.println(LOGIC); + + Serial.print("PZDET "); + Serial.println(PZDET); + Serial.print("VM_CONST "); Serial.println(voltMeterConstant); + + Serial.print("Firmware Version "); + Serial.println(PP_VERSION); } void serialPrintState() { @@ -189,6 +210,15 @@ void serialPrintState() { Serial.print("\"Err\":"); Serial.print(ERR_STATE); + Serial.print(","); + + Serial.print("\"PzCon\":"); + Serial.print(PZ_STATE); + Serial.print(","); + + Serial.print("\"Firm_Ver\":"); + Serial.print(PP_VERSION); + Serial.print(","); Serial.println("}"); } @@ -213,6 +243,12 @@ void updateParams() { else if (strcmp(serialMessageIn, "HYST") == 0) { updateHysteresis(); } + else if (strcmp(serialMessageIn, "LOGIC") == 0) { + updateLogic(); + } + else if (strcmp(serialMessageIn, "PZDET") == 0) { + updatePzDet(); + } else if (strcmp(serialMessageIn, "CONST") == 0) { updateConstant(); } @@ -222,32 +258,40 @@ void updateParams() { else if (strcmp(serialMessageIn, "CONFIG") == 0) { serialPrintConfig(); } - else if (strcmp(serialMessageIn, "RESET") == 0) { - resetEEPROM(); + else if (strcmp(serialMessageIn, "ERASE") == 0) { + eraseEEPROM(); serialPrintConfig(); } else if (strcmp(serialMessageIn, "STATE") == 0) { serialPrintState(); } else if (strcmp(serialMessageIn, "HELP") == 0) { - // Serial.println("To change gain factor: GAIN_F [integer for gain state - see note*]"); - // Serial.println("To change voltage follower voltage (low threshold): VFOL [float value]"); - // Serial.println("To change comparator voltage (high threshold): VCOMP [float value]"); - // Serial.println("To change main loop period: LOOP_D [integer for milliseconds]"); - // Serial.println("To change trigger active duration: TRG_D [integer for milliseconds]"); - // Serial.println("To change ADC hysteresis value: HYST [integer]"); - // Serial.println("To enable or disable debug output: DEBUG [0|1]"); - // Serial.println("To print current config: CONFIG"); - // Serial.println("To reset config to defaults: RESET"); - // Serial.println("To print current state: STATE"); - // Serial.println(""); - // Serial.println("Commands are entered in this format:"); - // Serial.println("CMD VAL"); - // Serial.println("Commands are confirmed with Enter key"); - // Serial.println(""); - // Serial.println("Examples:"); - // Serial.println("GAIN_F 3 <~ set gain factor to index 3 (6x)"); - // Serial.println("VFOL 2350 <~ set the vref floor to 2.35V"); + #if defined(ARDUINO_AVR_ATmega328PB) + Serial.println("To change gain factor: GAIN_F [integer for gain state - see note*]"); + Serial.println("To change voltage follower voltage (low threshold): VFOL [float value]"); + Serial.println("To change comparator voltage (high threshold): VCOMP [float value]"); + Serial.println("To change main loop period: LOOP_D [integer for milliseconds]"); + Serial.println("To change trigger active duration: TRG_D [integer for milliseconds]"); + Serial.println("To change the output logic: LOGIC [0|1]"); + Serial.println(" (0 for active low, 1 for active high)"); + Serial.println("To enable piezo plugged detection: PZDET [0|1]"); + Serial.println(" (0 for disabled, 1 for enabled)"); + Serial.println("To change ADC hysteresis value: HYST [integer in millivolts]"); + Serial.println("To enable or disable debug output: DEBUG [0|1]"); + Serial.println("To print current config: CONFIG"); + Serial.println("To set config to defaults: ERASE"); + Serial.println("To print current state: STATE"); + Serial.println(""); + Serial.println("Commands are entered in this format:"); + Serial.println("CMD VAL"); + Serial.println("Commands are confirmed with Enter key"); + Serial.println(""); + Serial.println("Examples:"); + Serial.println("GAIN_F 3 <~ set gain factor to index 3 (6x)"); + Serial.println("VFOL 2350 <~ set the vref floor to 2.35V"); + #else + Serial.println("Check docs.pyroballpcbs.com/config"); + #endif // defined(ARDUINO_AVR_ATmega328PB) } parseData(); } diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_volatile.h b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_volatile.h index 38852e1..a3f5e07 100644 --- a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_volatile.h +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_volatile.h @@ -3,6 +3,7 @@ volatile int sensorHReading = 0; // variable to store the value read from t volatile int ADJ_FOLLOW = 0; // Variable for Follower adjustment volatile int ADJ_COMP = 0; // Variable for Comparator adjustment volatile int ERR_STATE = 0; +volatile int PZ_STATE = 0; int Vin = 5000; // input reference voltage in millivolts (multiply V by 1000) int VOld = 5000; // Variable to store previous cycle's Vin @@ -23,7 +24,7 @@ int VFol = 0; // Error blink parameters -int BlinkState = LOW; +int BlinkState = 0; int BlinkCount = (InitCount * 2) + 1; // Multiply Blink count by 2 to handle toggle state, add one extra to make sure light is on after // Serial Input Parsing Variables diff --git a/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/version_git.py b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/version_git.py new file mode 100644 index 0000000..760556b --- /dev/null +++ b/firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/version_git.py @@ -0,0 +1,4 @@ +import subprocess + +major_version = "2.2.1" +print("-DPP_VERSION=\\\"" + major_version + "_" + subprocess.check_output(["git", "rev-parse", "HEAD"])[0:6] + "\\\"") diff --git a/mkdocs.yml b/mkdocs.yml index 822f4c4..9313d50 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -59,6 +59,9 @@ nav: - Makerbot Original Under Bed: 'mounts/quadrap/makerbot-under-bed.md' - Ultimaker Under Bed: 'mounts/quadrap/um-under-bed.md' - Configuration: + - Update Sensor: + - Sensor UART Wiring: 'schematics/other/uart-programmer-wiring.md' + - Beta v2.x.x: 'tutorials/firmware-update/beta-unit-firmware-update.md' - Pyr0-Piezo Config: 'config.md' - Settings Explaination: 'tutorials/config/pyr0piezo-parameters/pyr0piezo-parameters.md' - Printer Firmware Config: @@ -87,6 +90,8 @@ nav: - Changelog: - Version List: 'changelog.md' - Logs: + - 'v2.2.0-v2.2.1': 'changelogs/changelog_2020-01-16_v2.2.0_v2.2.1.md' + - 'v2.1.5-v2.1.6': 'changelogs/changelog_2019-12-28_v2.1.5_v2.1.6.md' - 'v2.1.4-v2.1.5': 'changelogs/changelog_2019-10-30_v2.1.4_v2.1.5.md' - 'v2.1.3-v2.1.4': 'changelogs/changelog_2019-10-09_v2.1.3_v2.1.4.md' - 'v2.1.2-v2.1.3': 'changelogs/changelog_2019-09-25_v2.1.2_v2.1.3.md'