Trouble using ALFAT OEM's SPI interface with a DsPic

I actually think your clock signal is wonky. I would expect clear hi/lo transitions, even with the jitter you see on the other signals. but instead you end up with that blocky section when the clk signal is meant to be rising/falling uniformly. I also don’t understand why MOSI went high when SSEL did the first Lo/Hi Transition.

Upshot: I don’t think I can guide you to setting up DsPic properly to interface with an SPI device… it could be something electrically (but I doubt it), but looks very specifically to be your signal…

The transitions on the CLK are actually clearer than that, you can see it better on the close-up accompanying this post. From afar they just look like blocks indeed.

MOSI going high at the same time as SSEL is due to the configuration I did, they both go high right before I launch Reset to choose the SPI interface.

I really don’t understand what’s going on here…
Thank you for you inputs either way, it is much appreciated !

@ Ava R. -

take a look in post #3 from https://www.ghielectronics.com/community/forum/topic?id=17616&page=1. You may find out correct configuration.

From that post, they just did clean up their driver and it worked.So you can try to take a look at your driver again to make sure that everything was config correctly.

I deleted and created a whole new SPI block to make sure that all the parameters were right but there is no change, still no answer from the ALFAT. I tried to play on the delays, giving it more time to react but again, no sign of life.
I don’t get it !

(you don’t know how much I hate saying this) do you have an Arduino you can prove your ALFAT over SPI does/not work ? I honestly think there’s a disconnect in the way you’re handling the data but while we keep playing in DsPic world (where unfortunately you have no friends / proof points in this forum) we will continue to struggle to help.

@ Ava R. -

Assuming that all connections are good, and you enter SPI mode successfully. I am thinking:

  • The frame is sent too early after reset so MISO is all zero. Try to delay 1-2 seconds. Just for testing.
  • ALFAT is in Bootloader mode because of somehow. Make sure firmware mode is running. You can check by UART.
  • Your MCU pull the MISO low all the time. Leave this pin disconnect with your MCU and measure it from ALFAT.
  • Try low frequency, should be about 1 MHZ. Increase it later when everything run well at this frequency.

Dat, your first advice was the right one ! I modified the delay and put it at 1 second and now I do get an answer from the ALFAT !

Thank you both a lot for your assistance on this !

1 Like

@ Ava R. -

1 second is too long, in your code, you should poll the commands to check whenever the banner is available, or check DataReady pin.