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

Hardware SPI in 18F2620 ?

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



Joined: 15 Dec 2007
Posts: 13

View user's profile Send private message

Hardware SPI in 18F2620 ?
PostPosted: Fri Mar 28, 2008 3:33 pm     Reply with quote

Im just moving some working code from 16F877A PCM C 4.06
to:
18F2620 using PCH 4.069

It complains that:
#use spi (SPI1, MASTER)
is "Option invalid Not valid for H/W"

Yet 18F2620 has the same master capable MSSP like 16F877A

Anyone know why?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 28, 2008 3:58 pm     Reply with quote

The #use spi() statement defaults to using "LSB_FIRST". But the
hardware SPI module uses MSB first. So to avoid getting this error
message, you have to put in the MSB_FIRST parameter in the #use spi
statement, when you use the hardware SPI module. Ideally, CCS
should fix this. It should default to MSB first.

Also, it wouldn't hurt if you specify a few more of the parameters
so that they aren't left as some unknown default value. Example:
Code:
MODE=0, MSB_FIRST, BITS=8, BAUD=250000

Make sure that the baud rate is actually one that can be achieved
by the hardware.
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