...
POST No. 2408024
Error when connecting an AS5048A angle sensor to OpenCR 1.0 Board
2021-02-25 20:04:46 Hertzog

Hello Community,


i am currently trying to connect an AS5048A angle sensor via SPI to my OpenCR Board.

I am using the Arduino IDE with the already installed OpenCR Board driver.


I connected the sensor via SPI Pins 10-13 according to the datasheet.

But when i read out the sensor, i only get strange, unusable data, that doesnt change accordingly to moving the sensor.


I already checked the wiring and was able to read the sensor with the exact same circuit and basically the same sketch, so the sensor and the wiring should be fine. 

Also since OpenCR is using the Arduino Framework and therefore the functions for accessing SPI should be used in the same way.


I attached the Sketch, with which i was able to read the sensor with the Arduino Nano.

If needed i can later on upload the Sketch i used for the OpenCR, but the functions look basically the same.


Do you have an idea what i did wrong? 


2021-02-25 20:04:46
Hertzog
2021-02-25 20:09:25 Johann Herzog

I should add, that i am already able to load firmware to the OpenCR controller. Also i checked that the CS Pin of the connector is working and is changing from LOW to HIGH when data is written/received.


2021-02-25 20:09:25
Hertzog
2021-03-01 16:05:50 Johann Herzog
The sensor is working now. Seems like the OpenCR Board, other than the Arduino Board, needs a little delay between sending a request and receiving the answer. A delay of 15 Microseconds was fine for me. Second modification was to connect the GND of the Arduino Uno-layout Pins to the GND of the 3.3V Powersupply of the board.
2021-03-01 16:05:50
Hertzog
2021-03-02 11:52:38 Will Son

Hi,


Thank you for reporting the issue, and suggesting the solution for it.

We'll look into the SPI library and see if there's any reason for such delay in SPI communication.

One thing that don't understand is that the GND of the Arduino pins and the GND(- signed) of the 3.3V header are connected already with the same ground over the board.

Does connecting these two pins make a significant change?

Thanks for sharing the update!!

2021-03-02 11:52:38
willson
2021-03-03 15:57:27 Johann Herzog

It might also have been a connection issue, because i didnt connect the GND of the 3.3V connection via the proper connector type, but with a standard female jumper cable.


I will try to replicate the error by time to make sure its not only fixed temporarily.

2021-03-03 15:57:27
Hertzog