2025-09-03 11:18 PM - last edited on 2025-09-04 1:11 AM by Peter BENSCH
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
2025-09-04 12:43 AM
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.
2025-09-04 1:24 AM - edited 2025-09-04 1:25 AM
welcome to the forum.
Please see How to write your question to maximize your chances to find a solution for best results.
In particular:
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...
2025-09-04 3:40 AM
Hi Frank,
As I see from this screen:
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:
So, 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
2025-09-04 3:59 AM
> 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 ?
2025-09-04 4:08 AM
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
2025-09-04 4:48 AM
2025-09-04 5:28 AM
2025-09-04 5:51 AM
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
2025-09-04 6:03 AM
Which side of the isolator is that?
Can you view both sides at once?