38.2. Tamagawa encoder communication
38.2.1. Overview
Communication with Tamagawa encoders using peripherals such as PLA, DMA, SPI, etc.
Get data with different DataIDs
Read and write EEPROM
Error messages (CRC errors, communication errors, encoder error messages)
Communication delay compensation
38.2.2. Board Setting
Expansion board
TMAGAWA RevAto plug into the core boardConnect encoder
TS5700N8401Plug in J2 pins 1 and 2 on the board
TMAGAWA RevA
38.2.3. Running the example
When the project is running correctly, the serial terminal will output the following information, and the position information will change when the encoder axis is rotated:
cmd:3 time:638, abs pos:4170741, abm pos:0, id:23.
cmd:3 time:631, abs pos:4170741, abm pos:0, id:23.
cmd:3 time:631, abs pos:4170740, abm pos:0, id:23.
cmd:3 time:634, abs pos:4170740, abm pos:0, id:23.
cmd:3 time:639, abs pos:4170741, abm pos:0, id:23.
cmd:3 time:632, abs pos:4170741, abm pos:0, id:23.
cmd:3 time:630, abs pos:4170742, abm pos:0, id:23.
Note
Call
tmgw_message_processfunction to update the data oftmgw_msg, which contains the information of the above functionSwitching command, you need to modify
tmgw_dev.comm_time_delay_configto turn off the communication function, and then do the configuration of PLA , DMA. Otherwise, it will generate an error message once and then return to normal