Skip to content

Commit

Permalink
fix #39 (#41)
Browse files Browse the repository at this point in the history
- fix #39 support for Wire2 on ESP32
- update readme.md
  • Loading branch information
RobTillaart committed Jun 28, 2023
1 parent c9ca15a commit 319985d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
5 changes: 3 additions & 2 deletions AS5600.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -75,6 +75,7 @@ bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin)
if (! isConnected()) return false;
return true;
}

#endif


Expand Down
4 changes: 2 additions & 2 deletions AS5600.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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?


Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=AS5600
version=0.3.8
version=0.4.0
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for AS5600 and AS5600L magnetic rotation meter.
Expand Down

0 comments on commit 319985d

Please sign in to comment.