# From Q2687 to Q2698 SPI problems

**URL:** <https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154>\
**Category:** Legacy AirPrime modules\
**Created:** [April 16, 2014, 9:56am UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154 "2014-04-16T09:56:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![radmaster](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@radmaster](https://forum.sierrawireless.com/u/radmaster)\
**Post date:** [April 16, 2014, 9:56am UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/1 "2014-04-16T09:56:37Z")

</div>

Hello,  
i was upgrading my Open AT application from Q2687 Module to the newer Q2698  
using a 7.52 A1 beta firmware release.  
This software make use of the spi\_1to communicate with a connected SD card.  
While on the previous module the same code it’s doing good and the SD card is responsive,  
on the Q2698 i can’t receive nothing on the SPI In pin (the cards does not initialize).

Reading the Q2698 manuals, i’ve done the following changes to accomplish the job:

- changed the CS (spi\_1) Pin from GPIO 31 to GPIO19.
- changed the adl\_busSettings\_u-\>clk\_speed from 0 (13Mhz on Q2687) to 15 (12.xx Mhz on Q2698)

but never seen any spi in data coming out the SD card.

Observing the waveform using an oscilloscope w 3 probes i can see those differences between the old and the new module:

- When using adl\_busWrite command on the Q2687 electrical level is mantained in High level state until just before the clock begins to pulse then writes data. On the Q2698 is in Low level state until just the clock begins.
- on the Q2687 the clock pulses are very regular and syncronized perfectly with data line, on the Q2698 there are clock pauses between every byte written even i’m using a adl\_busWrite command with 6 or 8 byte stream.
- at lower clock rates (250khz, 500khz) data loss have been observed (3 byte written on 6 byte write command).

note: if you need Oscilloscope images i can send them.

could you investigate on this strange issues?  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![radmaster](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@radmaster](https://forum.sierrawireless.com/u/radmaster)\
**Post date:** [April 16, 2014, 2:17pm UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/2 "2014-04-16T14:17:20Z")

</div>

Hello,  
i’ve taken 4 pictures of the “problem” from my oscilloscope.  
There are 3 probes connected:

Yellow line - Spi1\_Out (to the SD card)  
Blue Line - Spi1\_ClK  
Violet Line - Spi1\_CS

The first two are taken from the Q2687 sending the first initialization command to the SD Card. The command,  
as you can read, is 0x40 0x00 0x00 0x00 0x00 0x95 , 6 byte long. This command is accepted from SD card correctly (we have response on the spi1\_in after the command).  
The latter are taken from the Q2698, and are in evidence the pauses between byte transfers (command is passed as a 6 byte buffer to the adl\_buswrite function) and the strange electrical level of the clock.  
In this case the SD remains in is hiberantion state and does not answer data to subsequent clock pulses.

 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/a/a806c05edddcbfa7f4cacb0433866e1f2c287363.jpg)  

 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/9/9fa34441cdb17331ce408df93249bee088286207.jpg)  

 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/1/1df5755d0d7493f40e3285a9e710bf75bb933ae5.jpg)  

cannot upload more photo, see next post…

---

<div class="post-metadata">

**Author:** ![radmaster](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@radmaster](https://forum.sierrawireless.com/u/radmaster)\
**Post date:** [April 16, 2014, 2:18pm UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/3 "2014-04-16T14:18:45Z")

</div>

![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/9/9bedc860e9e6d2e25a03c06aa008771fba751f99.jpg)  

hope this could be of help.

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [April 17, 2014, 3:24am UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/4 "2014-04-17T03:24:49Z")

</div>

Hiya,

Just a thought - have you got your logic level translation right? The Q2898 has 2V8 SPI I/O, and off the top of my head a SD card is 3V3.

Also, are you using SPI1 or SPI2 - SPI2 is shared with UART2 and only one can be active at any one point in time.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![radmaster](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@radmaster](https://forum.sierrawireless.com/u/radmaster)\
**Post date:** [April 17, 2014, 8:25am UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/5 "2014-04-17T08:25:07Z")

</div>

hi Dave,  
thank you for your answer.  
As you can see from images (1V scale), ever the q2687 module uses the 2V8 spi levels to communicate with SD card, and do it good.  
I’ve tested various SD-Cards and are all 2V7 to 3V6 tolerant as seen from specification sheets.  
On the Q2698 module have tested spi1 at first (images above), then the spi2 disabling the Uart2 (at+wmfm command=0,0,2 and not subscribing with fcm with adl command any uart2).  
The diagrams of the spi2 protocol are level and time comparable to those of spi1.

---

<div class="post-metadata">

**Author:** ![Schaub\_GLYN\_DE](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@Schaub\_GLYN\_DE](https://forum.sierrawireless.com/u/Schaub_GLYN_DE)\
**Post date:** [April 17, 2014, 2:51pm UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/6 "2014-04-17T14:51:25Z")

</div>

Please note that Q2698 only supports a lower current on 2.8V GPIO pins than Q2686/Q2687  
IOH (I out high ) is specified at 150uA for 2.8V GPIO. (Q2698 PTS, section 4.2)  
If there is too much load on these lines, this could at least explain the signal waveform.

---

<div class="post-metadata">

**Author:** ![radmaster](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@radmaster](https://forum.sierrawireless.com/u/radmaster)\
**Post date:** [April 18, 2014, 8:41am UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/7 "2014-04-18T08:41:51Z")

</div>

I don’t tink it’s a current issue, the next picture shows pins status captured directly with Oscilloscope probes without SD attached to them.  
The levels are comparable to the previous.

 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/9/95d9c37387f153d498c92d14189176d30ab7c8d2.jpg)

---

<div class="post-metadata">

**Author:** ![mzboiu](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mzboiu](https://forum.sierrawireless.com/u/mzboiu)\
**Post date:** [May 9, 2014, 9:32pm UTC](https://forum.sierrawireless.com/t/from-q2687-to-q2698-spi-problems/7154/8 "2014-05-09T21:32:44Z")

</div>

Hi radmaster,

Have you found any solution?

I’m having the same issue  
but think I’ve found my problem  
seems it is the low level idle state of the SPI data output line during the read operation  
on Q2687 it is held high, while on Q2698 it is held low

and my current solution for Q2698 is in sending few spare 0xFF bytes before any command – after doing it I’m getting the correct response from the SD card

hope that will be helpful for you

I did not found how to change the idle state of the data output line  
it is also a shame that is not possible to read during the write operation

 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/5/5e90c4a6814f814820c6606eaf86e0cfeab41114.png)  

 ![](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/9/9bf6fc958598075d1e3342ba1b30a5a79866ac1d.png)
