Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 15th April 2008, 08:37 PM   (permalink)
Default I2C Cracked - next SPI....

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 is offline  
Reply With Quote
Old 15th April 2008, 08:48 PM   (permalink)
Default

Check out Microchip Application Note 1045.


Link added

Last edited by eng1; 15th April 2008 at 08:55 PM.
eng1 is offline  
Reply With Quote
Old 16th April 2008, 12:14 AM   (permalink)
Default

Quote:
Originally Posted by UTMonkey
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.

Quote:
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.

Quote:
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.

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...

Quote:
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: sdcard_appnote_foust.pdf

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

Toshiba SD Card Spec: TOSHIBA_SD_Card_Specification.pdf

Some links:
http://www.k9spud.com/sdcard/
http://www.kronosrobotics.com/Projects/MMC.shtml
http://uanr.com/sdfloppy/
http://www.roland-riegel.de/sd-reader/index.html
http://pinouts.ru/Memory/sdcard_pinout.shtml
http://www.technick.net/public/code/...onmem_sdcard_9
http://www.maxim-ic.com/appnotes.cfm/an_pk/3969
http://www.captain.at/electronics/pic-mmc/
http://www.mcu.fluxfocus.com/documents/SDSPI/sdspi.htm
http://www.maxim-ic.com/appnotes.cfm...te_number/4068
__________________
=========================
Futz's Microcontrollers & Robotics
=========================

Last edited by futz; 16th April 2008 at 05:06 AM.
futz is online now  
Reply With Quote
Old 16th April 2008, 12:36 AM   (permalink)
Default

Since you have both a PICkit2 & a Junebug use one for the Logic Analyzer and watch the SPI or I2C bus.
I've got to try that myself
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 16th April 2008, 12:37 AM   (permalink)
Default

Quote:
Originally Posted by blueroomelectronics
Since you have both a PICkit2 & a Junebug use one for the Logic Analyzer and watch the SPI or I2C bus.
I've got to try that myself
Ya! I'm gonna do that!
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now  
Reply With Quote
Old 16th April 2008, 12:47 AM   (permalink)
Default

Post your results, you'll need to convert the BMP to PNG or GIF.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 16th April 2008, 12:53 AM   (permalink)
Default

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.
donniedj is offline  
Reply With Quote
Old 16th April 2008, 05:05 AM   (permalink)
Default

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 by 3v0; 16th April 2008 at 05:10 AM.
3v0 is offline  
Reply With Quote
Old 16th April 2008, 01:05 PM   (permalink)
Default

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...
http://www.dipmicro.com/store/index....&productId=596
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 16th April 2008, 02:28 PM   (permalink)
Default

Quote:
Originally Posted by 3v0
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.

Quote:
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. The screws come with it. I dithered about installing Junebug in it for a while. Decided not to for now.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================

Last edited by futz; 16th April 2008 at 02:41 PM.
futz is online now  
Reply With Quote
Old 16th April 2008, 08:40 PM   (permalink)
Default

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).

Quote:
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 is offline  
Reply With Quote
Old 17th April 2008, 02:04 AM   (permalink)
Default

Quote:
Originally Posted by UTMonkey
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.

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.

Quote:
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.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now  
Reply With Quote
Old 26th June 2008, 06:15 PM   (permalink)
Default

Why don't you simply use the microchips app note for FAT16 and FAT32. I used it and it worked on the first try!
__________________
Il give you shocking experience.
Someone Electro is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
SPI->I2C Converter dknguyen Datasheet/Parts Requests 16 12th March 2008 01:45 AM
Winbond SP03 i2c bitbang MikeC Micro Controllers 0 22nd February 2008 05:08 PM
SPI Testing with ENC28J60 mikesmixes777 Micro Controllers 9 17th January 2008 07:41 AM
Both parallel and spi in PIC microcontroller PLEASE HELP jitun2 Micro Controllers 12 24th October 2007 02:08 PM
Need help! I2c data bus with pic 16f84a rukshankb Micro Controllers 2 7th October 2007 11:57 AM



All times are GMT. The time now is 06:25 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.