Hi Kcore.
Thank you for testing.
It's working already for me and one coleague, what IDE are you using? We are bought using testing IDE compiled from git.
One thing important I forgot to mention, and is related to IDE version. This lib is set to use ODSR register, meaning this, that you MUST have OWER register set to 1.
This has been fixed in the IDE currently in git, can you compile it and repeat the test please?
There is also other way, in onewire.h, you have the following code for SAM3x.
#elif defined(__SAM3X8E__)
#define PIN_TO_BASEREG(pin) (&(digitalPinToPort(pin)->PIO_PER)) //to get Base PORT address
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) (((*(base+15)) & (mask)) ? 1 : 0) /*(Pio Offset: 0x003C) Pin Data Status Register */
#define DIRECT_MODE_INPUT(base, mask) ((*(base+5)) = (mask)) /*(Pio Offset: 0x0014) Output Disable Register */
#define DIRECT_MODE_OUTPUT(base, mask) ((*(base+4)) = (mask)) /*(Pio Offset: 0x0010) Output Enable Register */
#define DIRECT_WRITE_LOW(base, mask) ((*(base+14)) &= ~(mask)) /*(Pio Offset: 0x0038) Output Data Status Register */
#define DIRECT_WRITE_HIGH(base, mask) ((*(base+14)) |= (mask)) /*(Pio Offset: 0x0038) Output Data Status Register */
//#define DIRECT_WRITE_LOW(base, mask) ((*(base+13)) = (mask)) /*(Pio Offset: 0x0034) Clear Output Data Register */
//#define DIRECT_WRITE_HIGH(base, mask) ((*(base+12)) = (mask)) /*(Pio Offset: 0x0030) Set Output Data Register */
#include "pgmspace.h"
Replace it with the following lines:
#define DIRECT_WRITE_LOW(base, mask) ((*(base+14)) &= ~(mask)) /*(Pio Offset: 0x0038) Output Data Status Register */
#define DIRECT_WRITE_HIGH(base, mask) ((*(base+14)) |= (mask)) /*(Pio Offset: 0x0038) Output Data Status Register */
//#define DIRECT_WRITE_LOW(base, mask) ((*(base+13)) = (mask)) /*(Pio Offset: 0x0034) Clear Output Data Register */
//#define DIRECT_WRITE_HIGH(base, mask) ((*(base+12)) = (mask)) /*(Pio Offset: 0x0030) Set Output Data Register */
with:
//#define DIRECT_WRITE_LOW(base, mask) ((*(base+14)) &= ~(mask)) /*(Pio Offset: 0x0038) Output Data Status Register */
//#define DIRECT_WRITE_HIGH(base, mask) ((*(base+14)) |= (mask)) /*(Pio Offset: 0x0038) Output Data Status Register */
#define DIRECT_WRITE_LOW(base, mask) ((*(base+13)) = (mask)) /*(Pio Offset: 0x0034) Clear Output Data Register */
#define DIRECT_WRITE_HIGH(base, mask) ((*(base+12)) = (mask)) /*(Pio Offset: 0x0030) Set Output Data Register */
This way you will be using CODR and SODR to clear and set the bit in the port. This is independent of OWER, and probably solve your problem.
Can you test it again please?
Unfortunately, I have burned my Due yesterday with a electrical hazard, and I can't do any more testes meanwhile...
Thank you.
BR,
Joao