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

Undefined Identifier - setup_spi(SPI_SS_DISABLED) --Problem

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








Undefined Identifier - setup_spi(SPI_SS_DISABLED) --Problem
PostPosted: Mon Dec 22, 2008 7:00 am     Reply with quote

Hi,

I programmed a 18F4550 PIC and I successfully ran some tests. But now when I am compiling, the compiler gives the following error,

Undefined Identifier - setup_spi
Undefined Identifier - setup_vref

I am not using any SPI communications in my code. Following is the place where the error occurs,

Code:


void main()
{
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   //setup_timer_2(T2_DISABLED);
   enable_interrupts(INT_RDA);                                                 
   enable_interrupts(GLOBAL);                                                 
   setup_vref(FALSE);




What could be the error?

Thanks a lot.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Dec 22, 2008 7:41 am     Reply with quote

Always post your compiler version number!

Code:
   setup_spi(SPI_SS_DISABLED);
SPI_SS_DISABLED is used to disable the Slave Select (SS) pin at a SPI slave device. Here your setup is incomplete as the parameters for master or slave operation are missing.
If you just want to disable SPI , then use:
Code:
   setup_spi(FALSE);
Guest








PostPosted: Mon Dec 22, 2008 8:30 am     Reply with quote

Compiler version is 4.057

I changed the following,

Code:

setup_spi(SPI_SS_DISABLED);


into
Code:

setup_spi(FALSE);


But the problem is still there. And that code I posted earlier is a code that is auto generated from the PIC Wizard.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Dec 22, 2008 9:51 am     Reply with quote

Strange, both the original code and my suggested change compile in v4.057 without problems.

You didn't post a complete program, so my guess is you made an error at an earlier point in the code. Make sure your program starts with the line:
Code:
#include <18F4550.H>
Guest








PostPosted: Mon Dec 29, 2008 8:33 am     Reply with quote

Hi,

What if I completely comment out the two lines? It compiles when I did so. I do not want to use SPI in my program.

Thanks...
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 9:44 am     Reply with quote

Who told you to use a SPI built-in function in your code? SPI is disabled by default.
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