This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8308: Problem with writing and reading all register except 0x00

Part Number: DRV8308

Hi,

I am trying to use the drv8308 on our current project.

I am able to write/read register 0x00 of the chip.

When I try to read any of the other registers, I am reading 0xFFFF back from them (0x01 to 0x2A).

My SPI Speed is 288 KHZ.

My MISO Line has a pull-up resistor.

When I write and read register 0x00, all of the lines are nice and clean (0 to 5 volt signals) according to the scope and logic analyzer.

I have tried reading register 0x2a (Fault register). but all I get back is 0xFFFF. This is the same with all of the registers. All of the other SPI devices on the my SPI bus work perfectly.

I am definitely meeting all of the timing requirements according to the data sheet.

I have also looked at the threads where they are having issues with SPI.

Any thoughts as to why this is happening?

Thanks,

Reif Heck

Finna Sensors

  • Reif,

    Have you tried slowing down the SPI to see if it helps the issue?

    Can you share a scope image or logic analyzer result of the faulty reads?

    Regards,

    -Adam

  • Hi Adam,

    Thanks for the quick reply.

    I actually tried it with 144 KHZ but it doesn't make any difference.

    I'll put together a scope and analyzer trace for you shortly.

    Reif Heck

  • Adam,

    Here are the analyzer traces of the SPI transactions.

    The first two traces show the time from CS High to SCLK is 3.52 micro seconds and SPI SCLK period is 6.96 micro seconds. They also show the write and read of register 0x00. The Read of register 0x00 is obviously good.

    The last two traces show the read value of the FAULT Register 0x2A is 0xFFF.

    I can make a scope trace of this if you like.

    Thanks Adam,

    Reif

  • Adam,

    I put some printfs to see what I am reading back from registers 0x00 and 0x2A. I was actually able to see 0x0018 come back from 0x2A. If I initialize 0x2A to all 0s I read back 0x03FF which is different.

    Maybe i need to add some delay when reading back?

    This is starting to get weird ;~)

    Thanks Adam,

    Reif

  • Hi Adam,

    I am finally able to read the Fault Register 2A as 0x18.

    One thing I found is if the ENPOL bit is not set first in register 0x00, all other registers read as 0xFFFF.

    Also, the board manufacturer left RESET floating. Is that an issue? Should it be grounded instead of floating?

    Thanks for your help,

    Reif

  • Adam,

    Are you still around?

    Reif Heck

  • Reif,

    Sorry, E2E is not meant for real-time communication, there are delays. 

    RESET has an internal pull-down so no need to do anything to it unless you want to pull it high and reset the device.

    Yes the device must be enabled for readback to work. How is your ENABLE pin connected?

    Regards,

    -Adam

  • Hi Adam,

    Thank you for responding. I realize that this isn't real time so sorry for being a pest. That is why I opened a case ticket hoping to be able to get a one on one but I guess that isn't going to happen.

    Anyway, ENABLE and RESET are connected to GPIO pins of the ATMEGA 2560. I had the RESET tied to a GPIO pin that was set up as an input and and tied high with an internal pull-up resistor.

    I set the Polarity of the ENABLE to be Low Active in register 0x00.

    I will try setting these again now that we know the RESET Pin is actually tied to my processor GPIO. The board manufacturer just now sent me updated schematics.

    I'll let you know how it turns out.

    Thanks again for the help.

    Reif

  • Hi Adam,

    The RESET Line GPIO connection to the processor was set up incorrectly. It was configured as an unused GPIO pin. Unused GPIO Pins on the ATMEGA 2560 are supposed to set as inputs and internal pull ups are enabled. I set the Pin up as an output and now its right as rain (technically speaking).

    Thank you for your help.

    This can now be marked as resolved.

    Reif Heck

    Finna Sensors