gandrewstone / LIN

The LIN protocol implemented over Arduino APIs (Serial and Digital IO)
119 stars 46 forks source link

LIN response in frame #3

Closed radula22 closed 8 years ago

radula22 commented 8 years ago

Hello, i want to use arduino to controll stepper motors by AMIS 30621. As LIN driver i using TJA1028t. Arduino Mega 2560 - uart 1. With inicialization or send request i have no problem but when i want obtain actual motor position i cant read first byte from driver.

I using command GetActual Position what need to sesnd synchronization and ID from arduino and then immediately obtaining data from driver with checksum.

Data looks like this: break sync , 0x55 , ID , 0x8C,0x00,0x00,0x00,0x00,checksum break sync , 0x55 , ID - is from arduino 0x8C,0x00,0x00,0x00,0x00,checksum - response from driver

but i cant read first byte 0x8C and without it i cant do anything. i trying to read faster but everytime i cant read it. checksum without first bit is correct with error.

Thank you for response. Radek