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 14th August 2007, 10:25 AM   (permalink)
Default SPI interface

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.
patroclus is offline  
Reply With Quote
Old 15th August 2007, 01:17 AM   (permalink)
Default

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)
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Reply With Quote
Old 15th August 2007, 02:33 AM   (permalink)
Default

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?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com

Last edited by blueroomelectronics; 15th August 2007 at 02:40 AM.
blueroomelectronics is offline  
Reply With Quote
Old 15th August 2007, 08:12 AM   (permalink)
Default

Just google for 'PIC SD card', there are a number of examples on the net, and the magazine EPE did a series of articles about it a little while back. MikroBasic even supports it directly, have a look at:
http://www.mikroe.com/en/books/picbasicbook/08.htm#8.3
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 15th August 2007, 09:24 AM   (permalink)
Default

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?
patroclus is offline  
Reply With Quote
Old 15th August 2007, 09:37 AM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 15th August 2007, 02:14 PM   (permalink)
Default

How are you going to interface the SPI / micro to the SEGA Genesis?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 15th August 2007, 03:12 PM   (permalink)
Default

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.

http://www.consolasparasiempre.net/p.../MegaFlash.htm

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 by patroclus; 15th August 2007 at 03:15 PM.
patroclus is offline  
Reply With Quote
Old 15th August 2007, 03:22 PM   (permalink)
Default

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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply With Quote
Old 16th August 2007, 06:16 AM   (permalink)
Default

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 is offline  
Reply With Quote
Old 16th August 2007, 07:52 AM   (permalink)
Default

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

Quote:

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 16th August 2007, 09:34 AM   (permalink)
Default

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,...
patroclus is offline  
Reply With Quote
Old 16th August 2007, 09:48 AM   (permalink)
Default

The programmer hardware is the same, as long as you arrange for the correct pin connections - it just needs the software to support it.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Simple I2C interface chip? oeginc General Electronics Chat 20 29th March 2008 12:52 AM
877A to DAC (MCP4922)... SPI questions. ChemE Electronic Projects Design/Ideas/Reviews 1 8th June 2007 03:21 PM
pc I/O interface card raus Electronic Projects Design/Ideas/Reviews 4 30th May 2006 09:53 PM
how to interface a mechanical part with C# parthi2929 Robotics Chat 3 14th April 2006 11:10 PM
monitor for controller - what is interface stevez General Electronics Chat 0 18th August 2003 11:44 AM



All times are GMT. The time now is 07:42 AM.


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