Datalogger - getting started with SPI and PIC C
sonocide6
Posts: 4
Hi all,
I've got a parallax USB datalogger 27937 with the intention of being able to send some data from my PIC microcontroller to a USB thumb drive via SPI. I am using Microchip's C18 compiler and am fairly well versed in SPI communication.
I'm finding the documentation on how I might get started on this pretty lacking so I'm wondering if anybody can point me in the right direction.
I'm not sure about any procedures I need to follow (open file, write, close file, etc.) or what the SPI messages would be to execute these tasks.
Any help or a link to some example code would be extremely helpful.
Thanks!
I've got a parallax USB datalogger 27937 with the intention of being able to send some data from my PIC microcontroller to a USB thumb drive via SPI. I am using Microchip's C18 compiler and am fairly well versed in SPI communication.
I'm finding the documentation on how I might get started on this pretty lacking so I'm wondering if anybody can point me in the right direction.
I'm not sure about any procedures I need to follow (open file, write, close file, etc.) or what the SPI messages would be to execute these tasks.
Any help or a link to some example code would be extremely helpful.
Thanks!
Comments
For the Stamp examples, the Basic Stamp Manual is available online. There's an object in the Propeller Object Exchange that uses SPI mode with the Datalogger. The Propeller Manual is also available online.
I've got functions written for other devices that send discrete bytes or series of bytes to a SPI slave. In the case of the datalogger, do I need to send exactly 12 bits per transfer or can I send 2 bytes with trailing zeros as the four least significant bits?
I'm attempting to send the char 'E", then a CR then read back in the 'E' and a CR. I understand that this is a built in echo function and that it would be a decent way to test my connectivity to the datalogger.
Please let me know if i'm missing something major here! Mike, can you further explain your earlier "byte count" comment?
Thanks in advance!