• 0
adambro

SPI transfer failure using JTAG-SMT2

Question

I'm attempting to communicate with a digital potentiometer IC via SPI. 

On one of my Linux PCs, using the Adept 2 runtime, I can successfully read from the IC. However, when I move this onto another Linux PC, this doesn't work and I get zeros returned from the DspiPut function.

I've added a call to the DmgrGetLastError function following the call to DspiPut and this returns no error.

Looking at the electrical SPI signals, I cannot see any difference between the PC that works and those that don't.

So I'm struggling to see what is going wrong here. 

Is there anything I can try to investigate and resolve this?

Thanks.

 

The previously mentioned error code 1031 "The transfer is in progress or pending" error doesn't appear when calling DmgrGetLastError after the DspiPut call but actaully after the DspiDisable function. This may still be related but the association with the DspiPut call is less clear than I first thought.

Edited by adambro
Update following further testing to confirm location where previously mentioned error arises

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

@adambro

What value are you passing for the fOverlap parameter of DspiPut? Are you running the same Linux distribution on both Linux PC's and is the architecture the same? What is the architecture: x86, x64, or arm?

Thanks,
Michael

Share this post


Link to post
Share on other sites
  • 0

Many thanks for your response Michael. 

I have now managed to resolve this problem. What I was missing was a call to the DmgrGetTransResult function after the DspiPut to allow sufficient time for the data to be returned from the device. It is an overlapped transfer operation.

I should have really realised this earlier. The error code did point in this direction but I just wasn't able to quite work out how to use DmgrGetTransResult properly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now