Skip to content

Incorrect handling of AS5047 ? #12

@ctolzane

Description

@ctolzane

Hi,
In order to make the readEncoderDiagnostics function to work I have to comment the lines below in Serial.cpp. Problem seen in master and dev branches. Why do you read twice?
Christophe.

void readEncoderDiagnostics(int arg_cnt, char args) {
disableTC5Interrupts();
disableTC4Interrupts();
long angleTemp;

SerialUSB.println(diagnostics_header);

digitalWrite(chipSelectPin, HIGH);
delay(1);
digitalWrite(chipSelectPin, LOW);

SPI.transfer(0xFF);
SPI.transfer(0xFC);

digitalWrite(chipSelectPin, HIGH);
delay(1);
digitalWrite(chipSelectPin, LOW);

byte b1 = SPI.transfer(0xC0);
byte b2 = SPI.transfer(0x00);

// digitalWrite(chipSelectPin, HIGH);
// delay(1);
// digitalWrite(chipSelectPin, LOW);
//
// b1 = SPI.transfer(0xC0);
// b2 = SPI.transfer(0x00);**

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions