Q2687 SPI Problem

Yes,

i have an osziloscope.

The write zyklus is ok (look at picture attached)
First 4 Lines are MOSI
1.Line Interpreter
2.Line Data
3.Line Clock
4.Line CS (go low 18us bevor image and high 10us after)
and the same for MISO

then, the CS goes high for 200us and low again to read-Zyklus -> Write Zyklus is OK

Read-Zyklus:
MOSI is alway 0
clock is toggling
CS is low
MISO has some Data (different from 0 or FF)

Wireless CPU: Q2686H
Bootloader Version V08b0c
Firmware Build data: 12/12/08 - 15:34
Version: R73_00gg.Q2686H
Application OS: 06.20

Serial Clock Pin Nr 23
Serial I/O Pin Nr 25 (MOSI)
Serial I Pin Nr 24 (MISO)
Enable Pin Nr 22

Edit: Oh… see it’s the wrong Serie … can an andministrator split the thread please?

i think you mean move.
well. essentially there’s no difference between the Q2686 and the Q2687 except for the parallel bus.
so SPI operation is the same for both (including pin-layouts etc.)

if you trace the data right after you do the “adl_busRead” you get the same results?

also, are you sure the spi mode is right? (can’t tell the timings from your picture)

Yes,
the same data

Timing in the pic (clock freq 2Mhz)

No Idea?

nobody implemented a SPI befor? Can’t belive it

I do have SPI running, and i have had problems like you have, but my problems were always related to wrong spi-mode settings or bad connections.
so i’m a bit out of ideas right now.

hi fakulatus,
i am also working on same thing from last 4 days .i implemented spi communication but its not working properly…i am also studied basic example but its not useful for my application. my application is interfacing with sd card.
one thing i suggest after reading u r code configure the pins (25,24,22) by using io direction structure .i don’t think its not much necessary but my working working after making these modification .

if u don’t mind can u share u r code with us…

thanks
kiran

If i subscribe the GPIO, i can’t subscribe the SPI (ADL_RET_ERR_BAD_HDL If a GPIO required by the provided bus configuration is currently subscribed by an Open AT® application)

I looked a hundred times for hardware-errors, but can’t find anyone :frowning:

I’ve changed to the Wavecom-Demokit and have the same Problems, so it seams to me that can not be a HW-Problem.

What’s interessting:

spiHandl = adl_busSubscribe(ADL_BUS_SPI2, 1, &spiSettings) ;

Subscribe the SPI-Handel, but it’s sending on SPI1

spiHandl = adl_busSubscribe(ADL_BUS_ID_SPI,2, &spiSettings) ;

Returns -7, ADL_RET_ERR_BAD_HDL

But that should be the right code for subscribing the SPI Nr 2, shouln’t be?

my code is exactly the same as already published by fakulatus
and directly derived form the spi-example.

ah!, whart firmware version are you running?

spiHandl = adl_busSubscribe(ADL_BUS_ID_SPI,2, &spiSettings) ;

the above is working for me, and i’m running firmware version 7.3

Ok…

i have 7.3 too …

i try to download new firmware

Works now,

but i’m not shure if it was the Firmware …
Is ist posible, that the Chip reads FF if the MISO hold tristate?

Hi Dear all ,
we can exchange our ideas we can make good working code for SPI. Please share all your ideas we can give the final conclusion for this thread.First We Can clear these questions .
1.What are basic Steps need to implement SPI?
2.what are the basic steps while programming for wavecom module (Q2686)?
3.Is It necessary to use opcode and address in programming ?
if anyone don’t like it please leave this post…

good to hear :slight_smile:

tristate is just that the input is not driven by the module.
if no external source drives the line, then you will read noise. (which can mean that it reads 0xFF)

in my experience, continuous readings of 0x00 of 0xff, usually, point to bad connections somewhere.
but seeing that you problem seemed to be solved by re-uploading the firmware, it seems to me that some low-level setting got corrupted earlier on in the test cycle

  1. did you try to look up (and understand) the wikipedia article on spi? ( en.wikipedia.org/wiki/Serial_Per … erface_Bus )
  2. viewtopic.php?f=29&t=3826&p=15365&hilit=+spi#p15366
  3. depends on you application.

This has been explained to you before: viewtopic.php?f=46&t=267&p=15434&hilit=opcode+address#p15432

There was a physical problem ,
SPI works beautifull :smiley:

Can u guide me what are basic function call need to implement SPI.I read all basic manual of wavecom still i am getting problem…
thanks
kiran

what kind of problems do u have ?

Thanks for Your Response.Now i am interfacing q2686 with Sd Card through SPI communication.
i am implementing basic step For writting raw and reading raw data.That code works with AVR microcontroller working fine .I am using Same code using for Q2686 just read and write operation using q2686 Spi.
my problem is:
i am able to detect SD card (means SD Card intiliazation ) fine.
But for wrrting data and reading data its not working. its not giving any compiler errors or warrning…its reading garbage data…
i already i posted my code in this thread…
Thanks &Regards…
kiran.