cancel
Showing results for 
Search instead for 
Did you mean: 

AEK-COM-ISOSPI1 L9963T MISO and clock out of sync

Frank2201
Associate II

Greetings

I have weird situation with AEK-COM-ISOSPI1 and cannot figure out what is wrong. Maybe someone here is experienced with this device and can help me out.

I have absolute encoder with SPI. When i connect directly to uC all is working fine. Then i tried to use AEK-COM-ISOSPI1 and have next problem:

I can readout the encoder data just with command read, so i generate just clock to start readout from encoder. This works fine, because on encoder side i get correct data 0x9F45.

These data are transferred back to uC but here i get messy data from AEK-COM-ISOSPI1. I get data 0x5F61. When i look the SPI signals with logic analyzer i can see that MISO is not sync with CLK cycle. And encoder is always on the same position. 

Can anyone help me and tell what im doing wrong here.

 

My configuration is.

Encoder side:
NSLAVE=1
TxAMP=1
TXEN=1
ISOfreq=1
BNE=1
DIS=0
SPICLKFREQ=22kohm (8MHz)

Microcontroller side:
NSLAVE=0
TxAMP=1
TXEN=1
ISOfreq=1
BNE=/
DIS=0
SPICLKFREQ=/

Best regards

Frank

16 REPLIES 16
Frank2201
Associate II

OK, i tried to send data from uC to encoder. And i get messy data at encoder side too.

I send data from uC 0x8080 and i get data to encoder 0x8181.

Encoder gives me reply 0x8100 and i get data to uC 0x0100.

I send data 0x8080 from uC every 80us. Then i receive same incorrect data to encoder side 0x8181 every time.

Encoder gives me reply data 0x8100 every time. I get incorrect data to uC (0x8080, 0x4100,0x8000,0x8180, C100, 0x8100,....)

See example from logic analyzer for one cycle.

Andrew Neil
Super User

welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

In particular:

  • What microcontroller are you using, and on what board?
  • Please show your schematic of how you are using the AEK-COM-ISOSPI1.
  • Some good, clear photos of your setup would help.

 

Have you checked the SPI lines with an oscilloscope to confirm that they are clean, correct levels, etc?

If they aren't, a logic analyser may give misleading results...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
SRomeo
ST Employee

Hi Frank,
As I see from this screen:

SRomeo_0-1756981626257.png

you are decoding your SPI data on CLK Rising edge (which is wrong)

In this specific example, if you decode on CLK Falling edge, the decoded data will be the following:

SRomeo_1-1756981958018.pngSo, based on what you expect, you should adjust the configuration of your analyzer.
There seems to be no problems on the signals whatsoever.

I suggest you to check also the SPI configuration of your micro board, making sure data decoding are consistent

Best regards,
Simone Romeo, AEK Team

Ozone
Principal II

> I have weird situation with AEK-COM-ISOSPI1 ...

I had to look this part up, and it is basically an isolated signal coupler.

The symptoms suggests the signal channels get out of sync, or have different propagation times.
Have you tried with lower bitrates ?

Thank you SRomeo.

Im sure that both CPOL=0 and CPHA=0 are configured in logic analyzer.

And my bad about configuration above, i see that i mistakenly write wrong values. Sorry about it because im little messy, i tried multiple combinations and still didnt figure it out.

At master side i have both:

TXEN=0
BNE=0

This gives me SPI mode 0 which is also configured on STM32G4 controller.

Best regards

Frank

Thank you Ozone for suggestion.

Tried with lowest baudrate and problem persist.

Made some measurements with logic analyzer, see attachment.

ISOfreq=0

SPI clock to 250kHz

 

Best regards

Frank

Frank2201
Associate II

Tried with simple 8 bit data transfer.

Problem persist, I send 0x80 from microcontroller, i receive on other side 0x81.

Any idea?

 

Best regards

Frank

 

Hello Andrew

The hardware is custom made controller with uC STM32G4 series. Im 100% that hardware is OK because when i connect absolute encoder directly to controller, all seems OK.

Nothing specific about schematic. Directly connected to uC pins (CS, CLK, MISO, MOSI). I use separated power supply, 5V for L9963T and 3.3V for IO.

Yeah, checked with oscilloscope, the signals seems to be good - see attachment.

Here i send 8 bit data for example. Microcontroller sends 0x01, and i get on other side 0x03.

 

Best regards

Frank 

Which side of the isolator is that?

Can you view both sides at once?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.