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

Trouble getting hardware SPI to work with #USE SPI

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



Joined: 01 Mar 2010
Posts: 73

View user's profile Send private message

Trouble getting hardware SPI to work with #USE SPI
PostPosted: Mon Mar 01, 2010 7:45 pm     Reply with quote

Hi,

I'm using a PIC16F1934 and compiler version 4.105.

I've gotten the #USE SPI pre-processor directive to work successfully via software, but I have not gotten it to work correctly via hardware.

When I try to use the option "force_hw" I always get this error in the build output.

For example, here's what I got set:

Code:
#use spi(MASTER, IDLE=1, SAMPLE_RISE, LSB_FIRST, SPI1, FORCE_HW, ENABLE=PIN_D0, STREAM=STREAM1)


*** Error 99 Option invalid "NOPLLEN" Not valid for H/W

Anybody know what this means?
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Mon Mar 01, 2010 8:35 pm     Reply with quote

Apparently, with #use spi you can't use the lsb_first option AND force_hw. To send data lsb-first you'd need to use software SPI.

Read PCM's post (more than halfway down) http://ccsinfo.com/forum/viewtopic.php?t=39698

Rohit
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Mar 01, 2010 11:46 pm     Reply with quote

Quote:
Apparently, with #use spi you can't use the lsb_first option AND force_hw.

It should be no surprize, that hardware SPI is restricted to features that are present in the actual PIC hardware.
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Tue Mar 02, 2010 3:19 am     Reply with quote

FvM wrote:
It should be no surprize, that hardware SPI is restricted to features that are present in the actual PIC hardware.
True.....and the datasheet is the bible! Very Happy I guess they could have implemented LSB-first transmission with a little modification, the SSP buffer is only a shift register after all! But I guess Microchip has its reasons.

Rohit
picj1984



Joined: 01 Mar 2010
Posts: 73

View user's profile Send private message

thx!
PostPosted: Tue Mar 02, 2010 2:51 pm     Reply with quote

Thanks a million. I just mirrored the data I need to send to get around the LSB thing. Working now.

I'm definitely a huge fan of this forum now, I sent this into support over a week ago and have not even gotten a response yet. I put it on here and I get help in no time at all!
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