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

CLOCK in spi_read()

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



Joined: 12 Aug 2006
Posts: 2

View user's profile Send private message

CLOCK in spi_read()
PostPosted: Sat Aug 12, 2006 10:02 am     Reply with quote

Hello,
Can I define the number of bits to read?, or the same is, can I define the number of clock out. the system is a pic in a master spi comunication and I need to read 19 bits.

Thank you in advance.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Aug 12, 2006 12:08 pm     Reply with quote

The spi_read() function uses the hardware SPI module in the PIC.
It can only read 8 bits. So if you want to read 19 bits, you must
call spi_read() three times. This will read 24 bits.

If you want to read exactly 19 bits, you can do it with software SPI.
For examples, look at the CCS driver files for SPI eeproms, such
as 9346.c. Look for driver files in this folder:
c:\Program Files\PICC\Drivers
Xavi



Joined: 12 Aug 2006
Posts: 2

View user's profile Send private message

PostPosted: Sun Aug 13, 2006 3:45 am     Reply with quote

Thank you, now I know and I make my own routines.
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