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

Help with spi_write()...

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








Help with spi_write()...
PostPosted: Tue Dec 05, 2006 9:31 pm     Reply with quote

I am trying to interface with a digital compass (HM55B), and am trying to send it the initializing signals via spi. However, the compass is expecting the signals to be four bits long. Is there any way to use spi_write(), and only send four bits???

Thanks in advance
Ttelmah
Guest







PostPosted: Wed Dec 06, 2006 3:52 am     Reply with quote

No.
The hardware only supports 8 bit operation.
It is very easy to 'bit bang' though. Look at the example file 'PNI11096.c', which bit bangs out, and 8 bit command, followed by a 16 bit reply read back. Instead of 'axis', send your command. Amend th number of bits to 4, and your are 95% of the way there.

Best Wishes
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