Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2C Cracked - next SPI....

Status
Not open for further replies.

UTMonkey

Member
Hi all,

Got my I2C routines to work with a DS1307 and a 18F2550.

The next step I suppose is to have a tinker with SPI, I do have some RTC's coming from MAXIM so I shall have something to play with in the next couple of days.

I am very interested in data logging projects that are out there and I have read that SD cards can be read via SPI.

Great! however with the reading I have done so far, I have 2 questions

1. Where is the "official" documentation on interfacing with a SD via SPI?
2. I have read that FAT16 is copyrighted, if I was to develop and sell a product which incorporated the FAT structure - would I have to pay "Bill"?

Thanks

Mark
 
UTMonkey said:
Got my I2C routines to work with a DS1307 and a 18F2550.
I don't think I've ever (successfully) done I2C, but I have done SPI.

The next step I suppose is to have a tinker with SPI, I do have some RTC's coming from MAXIM so I shall have something to play with in the next couple of days.
SPI is super easy. Nothin to it.

I am very interested in data logging projects that are out there and I have read that SD cards can be read via SPI.
I'm working on exactly that right now. I have it all wired up and am just trying to puzzle out how to do the software. It's tougher than I expected, but I'll get it. :p

18F4620_sdcard002sm.jpg

That's a 18F4620 with a Futurlec SD/MMC Mini Board and a Logic Converter Mini Board. SD's are 3.3V. You can use voltage dividers, but I had one of these boards so...

1. Where is the "official" documentation on interfacing with a SD via SPI?
Unknown. But I have some useful stuff for you:

This is a GOOD one, and hard to find: View attachment sdcard_appnote_foust.pdf

This is the useful part of the MAXIM info in open document format: View attachment sdcard_info.zip

Toshiba SD Card Spec: View attachment TOSHIBA_SD_Card_Specification.pdf

Some links:
**broken link removed**
http://www.kronosrobotics.com/Projects/MMC.shtml
**broken link removed**
http://www.roland-riegel.de/sd-reader/index.html
http://pinouts.ru/Memory/sdcard_pinout.shtml
http://www.technick.net/public/code/cp_dpage.php?aiocp_dp=pinconmem_sdcard_9
**broken link removed**
http://www.captain.at/electronics/pic-mmc/
**broken link removed**
**broken link removed**
 
Last edited:
Have you considered using a micro with built in RTCC? The 24F series has an RTCC and supports USB called the 24FJ256GB faimily. 24F is relatively new and the USB versions are brand new. Few are aware of them.

Cracked? Did you implement your own software I2C? Its not cracked until you do this, otherwise it is only bruised.
 
The C18 compiler has software/BitBang support for I2C in library sw_I2C.h.

I used it to to read back sound files programmed into the EEPROMs with a Junebug. The tools are getting nice.

Futz, FWIW...I see your Junebug is not mounted. In the early days of electronics people used to mount projects on wood blocks. I still like that method, cut a block to the size of the board and use standoffs to mount the board. It makes it easier to work with, slides around less.
 
Last edited:
3v0 said:
Futz, FWIW...I see your Junebug is not mounted.
It's on little rubber (polyurethane) "feet". Five of them, four at the corners and one under the buttons. Doesn't slide all that much.

I've got to find a supplier of the BT-04 case, dipmicro sells em with a PCB for $6.40 The Junebug PCBs need about 0.5mm sanded off the bottom to fit perfectly. Now where to get the super tiny screws...
I have one of those. Bought it from DipMicro with the PCB for $6.40. :p The screws come with it. I dithered about installing Junebug in it for a while. Decided not to for now.
 
Last edited:
Cheers Futz, some great info there.

I don't know if you recommend this, but I would like to be able to build the modules you describe from scratch (SD and Logic Converter boards), I would still categorise myself as a newbie so think this may be useful, what do you think?

I think when I manage to fathom access to the SD via SPI I will start to look at some FAT routines, I might try doing it in ASM (yes I must like pain).

Cracked? Did you implement your own software I2C? Its not cracked until you do this, otherwise it is only bruised.
- DonnieDJ

Software I2C? I did it using the MSSP module of the 18F2550, is doing it in software tough?

Thanks again

Mark
 
UTMonkey said:
I don't know if you recommend this, but I would like to be able to build the modules you describe from scratch (SD and Logic Converter boards), I would still categorise myself as a newbie so think this may be useful, what do you think?
Certainly. There's nothing complex about these boards. They're just time savers, and if you count the time it took me to make all the connectors, more like time sinks. :D

If you want schematics just ask. The 5V to 3.3V chip is a LCX245. That board also has a 3.3V regulator on it. The SD socket board has jumpered pullups for the SD lines, a couple LEDs, a cap and the socket.

I think when I manage to fathom access to the SD via SPI I will start to look at some FAT routines, I might try doing it in ASM (yes I must like pain).
Ya, I plan to do it raw first too, and then worry about the filesystem. Asm isn't painful! It's nice! But I'm a C guy these days. :p
 
Why don't you simply use the microchips app note for FAT16 and FAT32. I used it and it worked on the first try!
 
Status
Not open for further replies.

Latest threads

Back
Top