From 319985dc30bb1eed3ddc290a107ee6579c276a43 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Wed, 28 Jun 2023 10:25:19 +0200 Subject: [PATCH] fix #39 (#41) - fix #39 support for Wire2 on ESP32 - update readme.md --- AS5600.cpp | 5 +++-- AS5600.h | 4 ++-- CHANGELOG.md | 7 ++++++- README.md | 22 ++++++++++++++-------- library.json | 2 +- library.properties | 2 +- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/AS5600.cpp b/AS5600.cpp index a9db50f..03ddeb6 100644 --- a/AS5600.cpp +++ b/AS5600.cpp @@ -1,7 +1,7 @@ // // FILE: AS56000.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.3.8 +// VERSION: 0.4.0 // PURPOSE: Arduino library for AS5600 magnetic rotation meter // DATE: 2022-05-28 // URL: https://github.com/RobTillaart/AS5600 @@ -56,6 +56,7 @@ AS5600::AS5600(TwoWire *wire) #if defined (ESP8266) || defined(ESP32) + bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin) { _directionPin = directionPin; @@ -65,7 +66,6 @@ bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin) } setDirection(AS5600_CLOCK_WISE); - _wire = &Wire; if ((dataPin < 255) && (clockPin < 255)) { _wire->begin(dataPin, clockPin); @@ -75,6 +75,7 @@ bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin) if (! isConnected()) return false; return true; } + #endif diff --git a/AS5600.h b/AS5600.h index 864703f..08c88bb 100644 --- a/AS5600.h +++ b/AS5600.h @@ -2,7 +2,7 @@ // // FILE: AS5600.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.8 +// VERSION: 0.4.0 // PURPOSE: Arduino library for AS5600 magnetic rotation meter // DATE: 2022-05-28 // URL: https://github.com/RobTillaart/AS5600 @@ -12,7 +12,7 @@ #include "Wire.h" -#define AS5600_LIB_VERSION (F("0.3.8")) +#define AS5600_LIB_VERSION (F("0.4.0")) // default addresses const uint8_t AS5600_DEFAULT_ADDRESS = 0x36; diff --git a/CHANGELOG.md b/CHANGELOG.md index c944a04..c661202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.4.0] - 2023-06-27 +- fix #39 support for Wire2 on ESP32 +- update readme.md + +---- + ## [0.3.8] - 2023-06-18 - add **void burnSetting()** improvements from #38 - use with care - add sketches to burn settings (use with care!) - minor edits. - ## [0.3.7] - 2023-05-09 - change **getCumulativePosition()** to use **AS5600_ANGLE** so filters can be applied. diff --git a/README.md b/README.md index 14de1be..fdc240e 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,22 @@ Please share your experiences. The I2C address of the **AS5600** is always 0x36. -The AS5600 datasheet states it supports Fast-Mode == 400 KHz -and Fast-Mode-Plus == 1000 KHz. -Tests with an AS5600L (UNO) failed at 400 KHz (needs investigation). - The sensor should connect the I2C lines SDA and SCL and the VCC and GND to communicate with the processor. Do not forget to add the pull up resistors to improve the I2C signals. +The AS5600 datasheet states it supports Fast-Mode == 400 KHz +and Fast-Mode-Plus == 1000 KHz. + +#### Pull ups + +I2C performance tests with an AS5600L with an UNO failed at 400 KHz. +After investigation it became clear that pull ups are mandatory. +The UNO expects 5 Volt I2C signals from the AS5600. +However the device only provides 3V3 pulses on the bus. +So the signal was not stable fast enough (not "square enough"). +After applying pull ups the AS5600L worked up to 1000 KHz. + #### DIR pin @@ -630,8 +638,8 @@ priority is relative. #### Must -- re-organize readme (0.4.0) -- rename revolution functions (0.4.0) +- re-organize readme +- rename revolution functions - to what? @@ -650,8 +658,6 @@ priority is relative. - 1 minute (need HW) - check Timing Characteristics (datasheet) - is there improvement possible. -- investigate why AS5600L failed at 400 KHz I2C - - repeatable? #### Could diff --git a/library.json b/library.json index 008d25d..bfc897e 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/AS5600.git" }, - "version": "0.3.8", + "version": "0.4.0", "license": "MIT", "frameworks": "arduino", "platforms": "*", diff --git a/library.properties b/library.properties index 7ea9b1d..0cd7a0b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AS5600 -version=0.3.8 +version=0.4.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for AS5600 and AS5600L magnetic rotation meter.