SPI with amt-203-V encoder | LabJack
 

SPI with amt-203-V encoder

2 posts / 0 new
Last post
TK
atkane's picture
SPI with amt-203-V encoder

I am currently using a T7 labjack to control an H-bridge driving a DC motor.

I would like to to use feedback from a 12-bit absolute position encoder(AMT-203-V specifically)

However, I cannot seem to get any response back from the SPI slave device and it seems like the specific communications protocol might be differently ordered on this encoder than is done in the default SPI lua example( specifically https://labjack.com/support/software/examples/lua-scripting/spi-example). 

"For example, to read the position the master will send the rd_pos command (0x10), it will then send no operation commands (nop_ a5, 0x00) until it receives the original rd_pos command back. Once it receives the rd_pos response from the encoder, it knows that the next two bytes of data will be the MSB and the LSB respectively. To receive those two bytes the master will send two no operation commands. It is recommended that the master leave a 20 μs delay between reads to avoid extending the read time by forcing wait sequences. Each byte transmitted must be followed by a release of the Chip Select line (CSB)."

I've been digging through the lua and SPI documentation but can't seem to find what I'm missing.

https://www.cui.com/product/resource/amt20.pdf

 

File Attachment: 
LabJack Support
labjack support's picture
That description sounds

That description sounds strange, but I don't see anything wrong with it.  Sounds like you just do 1-byte SPI transfers and follow the described sequence.

One thing I don't see in the datasheet is a spec for the MOSI logic thresholds.  The T7 gives about 3.3V for output-high, so you need to make sure the device recognizes that as a logic high.

It appears that the device also outputs the quadrature signals, in addition to having an SPI interface, so perhaps that is another option for you:

https://labjack.com/support/datasheets/t-series/digital-io/extended-feat...