Reading potentiometer position or angle with AS5600 board
In this blog I will expose the way to read an angle or position (in my case wind direction) trhough the board AS5600-SO_EK_AB, bought from Digikey https://www.digikey.es/product-detail/es/ams/AS5600-SO-EK-AB/AS5600-SO-EK-AB-ND/5066879
This is a fully mounted board, not equally as the picture, and I bought separatelly a magnet with a button which fits very well on top of the chip. If you turn the button, the value changes giving it a position. Link and picture of the button: https://www.digikey.es/products/es?keywords=RMH05-DK-XX-1.0
Pin B0 of the microcontroller must be connected to 3.3V and pin B1 is the output of the sensor to be read. The maximum input value is going to be 1.98V.
The program is called "AS5600.c" and it is based on ADC module port B. Configured as a single ended and channel 0 (although pin B1) and free run. Vref is taken by pin B0, for this reason you attached it to 3.3V. Finally you read it and channel 0 is converted as acdw variable.
See the program in pages, named "AS5600.c"
Program: AS5600.c
Comments
Post a Comment