Hello,
Recently I have been testing out the MCF8316A, and whenever i encountered an issue i was mainly able to find it throughout the forums, but this is an issue I am struggling to find much information on.
I am using the evaluation module kit (MCF8316AEVM) with external MC (an Arduino) and i have successfully wrote and read from the registers and wrote the registers to the EEPROM, so communication is established (all of this with CRC disabled).
It was when I was writing the speed and reading it (using I2C), and for the most part it would work and be accurate, but sometimes it would stop communicating properly and either wouldn't write the new speed or read a full register, or sometimes full register (aka reading FG_SPEED_FDBK gives me a value of 0xFFFFFFFF). I am aware of the errata with reading registers whist giving speed control using I2C, but shouldn't it be fine to read the register that is meant to be read whilst the motor is running, at least once every second? At least this was my train of thought, so I presumed that because i am not just re-writing the register with the new speed, but rather I am incrementing the DIGITAL_SPEED_CTRL register with a value of 0x06630000 (5% max speed), there was some corruption between the communication and wanted to implement the CRC to make sure the data stream is correct.
I implemented a CRC calculation in my code, and using online calculators i made sure that my results are correct and I am writing or reading the correct CRC value. When reading the MCF for CRC value for a certain data, though, i am getting a completely other value, that doesn't show up in any of the CRC8 algorithms. Now, i came across this forum article: https://e2e.ti.com/support/motor-drivers-group/motor-drivers/f/motor-drivers-forum/1120366/mcf8316a-cannot-clear-faults, and it does state that it is a custom CRC8, but the initial value and polynomial are the same as the ROHC, so i am using the ROHC look-up table.
Just to confirm the way to structure the CRC with example values of reading 0x440FCEC6 to the MOTOR_STARTUP1 register (0x84)
1) 0x02
2) 0xD0, 0x00, 0x84
3) 0x03 (since datasheet asks for + read bit)
4) 0x44, 0x0F, 0xCE, 0xC6
The calculated result is 0x13 and the value i am reading is 0x20
Is this the right order of doing it? I have also tried on 4) 0xC6, 0xCE, 0x0F, 0x44 , which i calculated to be 0x5D, which is still not the same as the 20 that i am getting from the MCF.
I would really appreciate it if someone could give some insight on why the motor speed write and read possibly bugging out, and the way the MCF calculates the CRC.
Thanks in advance!
Kind regards,
Jordan