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

PIC Wizard 16F88 Setup SPI Bug

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



Joined: 12 Mar 2007
Posts: 1

View user's profile Send private message

PIC Wizard 16F88 Setup SPI Bug
PostPosted: Mon Mar 12, 2007 12:22 pm     Reply with quote

Hi All,

I've rec'd a ton of help off of this forum, so I'm returning the favor.

I was having trouble with RS232 communications on the 16F88 after I upgraded to 4.027. I had started a new project with the PIC Wizard and pasted my code.

My communications no longer functioned and I kept receiving framing errors that would not clear.

Since I had not selected SPI, the PIC Wizard generated the following line of code:

setup_spi(FALSE);

The problem is, 'FALSE' is not a valid setup in the 16F88.H file.

The valid setups are:

Code:
////////////////////////////////////////////////////////////////// SPI
// SPI Functions: SETUP_SPI, SPI_WRITE, SPI_READ, SPI_DATA_IN
// Constants used in SETUP_SPI() are:
#define SPI_MASTER       0x20
#define SPI_SLAVE        0x24
#define SPI_L_TO_H       0
#define SPI_H_TO_L       0x10
#define SPI_CLK_DIV_4    0
#define SPI_CLK_DIV_16   1
#define SPI_CLK_DIV_64   2
#define SPI_CLK_T2       3
#define SPI_SS_DISABLED  1

#define SPI_SAMPLE_AT_END 0x8000
#define SPI_XMIT_L_TO_H  0x4000


As you can see, FALSE was interrupted as SPI_L_TO_H. Ouch!

All is well now. And I submitted a bug report.
_________________
Regards,

Brennan
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