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.

SPI interface

Status
Not open for further replies.

patroclus

New Member
I've been using PICs like 16F84 and 16F628 for a while, and also Compact Flash card interfacing projects. Now, I'm working in a SD flash card project, driven by a SPI protocol.

So far, I've been doing research/development using my PC parallel port and dedicated software, to easily teach myself how to communicate with the card.

Now, the question... I'm not sure how to build the SD card interfaz... the host could be any 8 bit data bus machine (either an old computer, videogame system, or microcontroller, or whatever,...)

Maybe get the logic into a CPLD? It woild be the fastest solution.
I suppose it would be easier to use a microcontroller, with SPI capabilities. If you have no SPI capabilities, it can still be done, with a little more effort.

What would you recommend me?
Maybe some PIC or SX chip (which are faster) ?
I never used AVR chips, though it seems that there're good tools out there.
 
I'd recommend an AVR myself, most of their chips support SPI directly, and those that don't can easily do it. AVR's really do exceptionally well at I/O compared to a PIC, I don't know much about the SX chips. All AVR's that are ISP programmable can be programmed with a simple parallel cable interface and free software available on the net (Ponyprog for one)
 
In what way is the AVR I/O better than the PIC I/O? The 16F628 has an SPI port.
Problem with SD is you have to write 512bytes of data at a time. An 18Fxxxx or dsPIC might be more suited as it has more RAM. Also SD is 3.3V not 5V
PS SD cards are not that fast to write to, how much speed do you expect?
**broken link removed**
 
Last edited:
blueroomelectronics,I don't need high speeds.
The compact flash project I built, loads games stored there, into a rewritable flash cartridge for SEGA Genesis. This rewritable cartridge uses 29F800 flash chip, and these kind of memory is quite slow to write, so I don't think the limitation will be the compact flash card or SD card.
I suppose SD in SPI mode would be some times slower to transfer data than compact flash, which has parallel data bus, but, much smaller and easier to wire up.

I suppose AVR is considered by Sceadwian, and many others, a better I/O chip, because AVR are faster than PIC. A standar 16F628 at 20MHz can get up to 5 MIPS. But a standar ATMega at 20MHz can reach 20 MIPS. In real time digital signal filtering can be a whole world of difference.
SX chips are very similar PICs but can work at up to 75MHz (75 MIPs), and that is awesome.

I suppose my problem now is not being sure about which one to use.
I only have a PIC programmer, I've only worked with 16F84 and 16F628 PICs up to date, and that is why I've been using them so far. But it seems there're other solutions bettern than a 16F628.
I know Microchp has better PICs but I just get lost when surfing their web site, as so many models available,... is there any place I can see the most popular ones?
 
Check the 18F series PIC's, these are very fast and use an extended instruction set, optimised for C - MicroChip provide a free C compiler for use with it. If you're looking for digital signal processing though?, you should be looking at the dsPIC series, intended for that job! - far better than an AVR for it.
 
There're so many 18f series chips, just don't know where to start :)
Also, the C18 compiler is only fully operative 60 days, and the ful version is not free...

The interface is done using a genesis running a BIOS written by me.
I've already managed to interface a compact flash and send/recieve saved games from and to a PC computer.

**broken link removed**

Quite hard and interesting project I think. Main dificulty is to write and make work the BIOS in genesis assembler because it is not easy to debug.
 
Last edited:
Since you've got it running with a CF card why would you want to change to an SD card?

It seems like a lot of work for something you can emulate on a PC.
 
no, it is not for this project. I'll be using it in future projects, that might be similar to this or might not.

Yes, it can be emulated on PC, but I just wanted to do something like this (it's kind of hobbyst project)
 
patroclus said:
There're so many 18f series chips, just don't know where to start :)

Check what specs you need and go from there, for example do you need USB?, if so you've just drastically reduced your options.

Also, the C18 compiler is only fully operative 60 days, and the ful version is not free...

But it's still fully functional, only some of the optimisations are removed after 60 days.
 
Yes, I'm doing that now.
What concerns me is the programmer. Do 18Fxxx require another programmer?
I use a Willem Programmer, and I think it is able to program 18fxxx, but I'll have to build a socket for it (only 16f84 socket is onboard), but I suppose only a few pins are used for programming,...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top