mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
doc: Improved QE Documentation and add mt6816 board profile doc
This commit explain that the QE encoder driver can be used to internal QE from microcontroller or external magnetic encoder. Also explains how to use the mt6816 board profile to STM32F4Discovery Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
committed by
Alan C. Assis
parent
928d7682ce
commit
51cd4a548f
@@ -1523,6 +1523,61 @@ After compiling and flashing the firmware in our board, run kbd command.
|
||||
code : 49
|
||||
type : 1
|
||||
|
||||
mt6816
|
||||
------
|
||||
|
||||
This board config enables the MagTek MT6816 Magnetic Rotary Encoder connected
|
||||
to STM32F4Discovery board SPI1 this way:
|
||||
|
||||
================ ======
|
||||
STM32F4Discovery MT6816
|
||||
================ ======
|
||||
3V [1] VCC
|
||||
GND GND
|
||||
PE3 CSN
|
||||
SPI1 MOSI (PA7) MOSI
|
||||
SPI1 MISO (PA6) MISO
|
||||
SPI1 SCK (PA5) SCK
|
||||
================ ======
|
||||
|
||||
1: You need to remove the diode D3 and short-circuit the PADs in the
|
||||
board to get 3.3V. Be aware: although my board works fine, it could
|
||||
damage something that expects 3V in our board (double check).
|
||||
|
||||
IMPORTANT: You need to connect the HVPP (pin 2) to VCC in order to get
|
||||
MT6816 working in SPI mode. Just short-circuit R3 pads will work:
|
||||
|
||||
.. figure:: mt6816.png
|
||||
:align: center
|
||||
|
||||
After compiling and flashing the firmware in our board, run qe command:
|
||||
|
||||
.. code:: console
|
||||
|
||||
NuttShell (NSH) NuttX-12.13.0
|
||||
nsh> ls /dev
|
||||
/dev:
|
||||
console
|
||||
null
|
||||
qe0
|
||||
ttyS0
|
||||
zero
|
||||
nsh> qe
|
||||
qe_main: Hardware initialized. Opening the encoder device: /dev/qe0
|
||||
qe_main: Number of samples: 0
|
||||
qe_main: 1. 6546
|
||||
qe_main: 2. 6620
|
||||
qe_main: 3. 7384
|
||||
qe_main: 4. 7808
|
||||
qe_main: 5. 7900
|
||||
qe_main: 6. 7984
|
||||
qe_main: 7. 7989
|
||||
qe_main: 8. 7993
|
||||
qe_main: 9. 7998
|
||||
qe_main: 10. 8008
|
||||
qe_main: 11. 8052
|
||||
qe_main: 12. 8064
|
||||
|
||||
netnsh
|
||||
------
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 179 KiB |
Reference in New Issue
Block a user