CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC16F877

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








PIC16F877
PostPosted: Sun Nov 19, 2006 8:53 am     Reply with quote

I currently using my SPI for an external ADC. Is is still possible to store my data in an MMC card using the other pins? Or do i really need to use the SPI? If i really need to use the SPI for the MMC, is it possible to use the external ADC w/o using the SPI? Thanks in advance.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sun Nov 19, 2006 9:29 am     Reply with quote

SPI protocol doesn�t have addressing capabilities.
Normal use of this protocol is enabling (addressing) the target device with a dedicated line.
You can use both devices sharing the same SPI lines, selecting its corresponding Chip Select.

Humberto
Guest








PostPosted: Sun Nov 19, 2006 8:46 pm     Reply with quote

If i use the same i/o lines for SPI (mmc & adc) are there any changes to the hardware i will have to implement? Thanks for reply.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Mon Nov 20, 2006 6:05 am     Reply with quote

We doesn�t know your hardware.

You would need to wire the SPI lines SI, CK & SO (if necessary) + Chip Select
to every device sharing the SPI bus.
This means that the system must have a separate Select line to
"address" the target device.


Humberto
Guest








PostPosted: Thu Nov 23, 2006 12:35 am     Reply with quote

If my ADC requires SPI_MODE_0_0 while my MMC requires SPI_MASTER wouldnt that create conflicts?
Guest








PostPosted: Thu Nov 23, 2006 12:41 am     Reply with quote

If my ADC requires SPI_MODE_0_0 while my MMC requires SPI_H_TO_L and the spi clock periods are diff wouldnt that create conflicts?

Code:

//ADC
   setup_spi(SPI_MASTER | SPI_MODE_0_0 | SPI_CLK_DIV_16);
//MMC
        SETUP_SPI(SPI_MASTER | SPI_H_TO_L | SPI_CLK_DIV_4 | SPI_SS_DISABLED);
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group