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 support@ccsinfo.com

ADS8344 works with DAC7634 on one SPI bus, but why?

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







ADS8344 works with DAC7634 on one SPI bus, but why?
PostPosted: Mon Jul 23, 2007 2:28 pm     Reply with quote

Hi all!

A former colleague of mine has developed a device based on a 16F877A @ 20 Mhz. In this device the PIC is the SPI master and communicates to two slave SPI devices: an ADS8344 (an ADC) and a DAC7634 (a DAC).

I am more a programmer than an electronics guy but looking at the datasheets of the ADC and the DAC as far as I can see the ADS8344 should work in SPI mode 0,0 while the DAC7634 should work in SPI mode 1,1.

Surprisingly the ADC and the DAC seem to work ok together. The SPI setup string of my former colleague is the following:

Code:
setup_spi(SPI_MASTER | SPI_H_TO_L | SPI_XMIT_L_TO_H | SPI_CLK_DIV_16 | SPI_SAMPLE_AT_END);


This setup string seems to represent SPI mode 1,1 (actually the one of the DAC7634) with the addition SPI_SAMPLE_AT_AND. If I refer to the 16f877a datasheet SPI_SAMPLE_AT_AND defines that the PIC's SMP bit is set high, which means "input data sampled at end of data output time". I had trouble figuring out what that exactly means but it sounds like it influences only the way the data that comes from the ADC is sampled by the PIC (or am I wrong?).

Now I am confused why the ADS8344 works at all in the above config (SPI mode 1,1). Or are there maybe some hidden problems?

Thanks for any help.

Best regards,
Zer0flag
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