GM862, Python, SPI and SD Card

I was just wondering if anyone has tried to use a SD Card with the GM862 units?

Seems like a good way to make a simple gps tracker/logger without using a microcontroller, just using the python.

Anyone had any experience with this?

I am attempting to do just this. I have kind little to no experience in this field either with a microcontroller or with th GM-862, so this might be a bit nerve racking.

Might be worth it though.

i use dual GSM card+SD reader holder. SD connect by SPI mode. Work fine - no problem.

DNZ, you were able to write a file to an SD card using a Python script?

The SD card was fat32? Or you just write to it as a simple memory (like you would do with an eeprom)

Thanks! :stuck_out_tongue:

OK, I’ trying to make this work, but I am having some problems, and I can’t figure them out…

First of all, here is my setup:

I have the RS232 break-out for the GM862 GPS from Sparkfun and a 32 mb MMC card for testing. I am using a 350W PC power supply for juice. I have connected the MMC to the 3.3v power rail and the GM862 breakout is connected to the 5v rail.

I have connected the two directly (no level conversion) on my breadboard like so:

CS - Pin 1 of MMC - GPIO7 on GM862

SDO - pin 2 - GPIO5

SDI - pin 7 - GPIO6

SCL - pin 5 - GPIO4

and I use a LED for below-basic debug-ing.

I am trying to reset the card, but no go, my code is as following:

#SD Commands
CMD0 = '\x40'
WAIT = '\x00'
CRC = '\x95'

#Initialize SPI port
SDCard = SPI.new(4,5,6,7)   # (SCLK, MOSI, MISO, CS)
SDCard.init(0,0,0,0)        # (CPOL, CPHA, SSPOL,SS)

#Program START
GPIO.setSLED(3,1,1)
SER.send('\r\n--------------------\r\nSending command\r\n')
response = SDCard.readwrite(CMD0+WAIT+WAIT+WAIT+WAIT+CRC,10)

#Print result
SER.send("response is :"+ hex(ord(response[0]))+ hex(ord(response[1]))+ hex(ord(response[2]))+ hex(ord(response[3]))+ hex(ord(response[4]))+ hex(ord(response[5]))+ hex(ord(response[6]))+ hex(ord(response[7]))+ hex(ord(response[8]))+ hex(ord(response[9])))

All I get back are 0’s, not what I am looking for…

Right now I am out of ideas, I am doing something wrong?

kind of late, but Merry Christmas!

Configuration is OK for MMC card?


p.s.

SPI object method: init (CPOL, CPHA, , )

This command performs the initialization on the SPI bus previously created, and can be reused as many time as necessary if some of its parameters need changes during work.

First input parameter CPOL represents clock polarity and is controlled in the following way:

• CPOL = 0 - clock polarity low\

• CPOL = 1 - clock polarity high\ Second input parameter CPHA represents clock phase transmission and is controlled in the following way:

• CPHA = 0 - data bit is clocked/latched on the first edge of the SCLK.\

• CPHA = 1 - data bit is clocked/latched on the second edge of the SCLK.\ The combinations of polarity and phases are often referred to as SPI modes.

Third parameter SSPOL is optional and represents the Slave Select Polarity and can assume the following values:

• SSPOL = 0 - polarity low (default)\

• SSPOL = 1 - polarity high\ Fourth parameter SS is optional and represents the Default Slave Select line number to use among the already defined slave select (SS) lines for this SPI object and then it can assume values from 0 to 7.

• SS = unused - means that if not SS settled in readwrite() parameter’s function, no SS will be moved.\

• SS = 0…7 – Defined the default SS line to move if not SS settled in readwrite() parameter’s function.\ Return value is a Python integer, which is -1 if an error occurred, otherwise is 1.

Ask Telit for the SD card SPI Python driver, they have it since December.

@byteworks: Do you have a link you could share? Is it for the GM862 or the GE863 PRO?

Thanks.

There isn’t any link, you must ask directly or through your vendor.

Is a Python driver, will work on all Telit modules with internal Python - not on PRO which has Linux.