Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of AS5047 ? #12

Open
ctolzane opened this issue Jan 26, 2020 · 0 comments
Open

Incorrect handling of AS5047 ? #12

ctolzane opened this issue Jan 26, 2020 · 0 comments

Comments

@ctolzane
Copy link

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);**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant