Pic18f6722 spi.h and open spi1 problem

Thread Starter

Picbuster

Joined Dec 2, 2013
1,052
When using pic18f8722 or pic18f87k22 spi.h will be found (many of my application are using this)
and OpenSPI1(SPI_FOSC_64, MODE_11, SMPMID); works

Following the manual and procedures to set the pic
However ; pic18f6722 or pic18f67k22 fails.

I am able to find spi.h using the list but compiler/linker can't find it so OpenSPI1(SPI_FOSC_64, MODE_11, SMPMID); can't work.
But it does find SPI_FOSC_64 MODE_11 SMPMID
pic18f8722 and pic6722 (picF18 family) should be compatible and are printed on same datasheet.

I do not use mcc that's a pain and not working correctly.

I build my own SPI drivers but want to use Microchips spi.h
Does any body know how to solve this problem?

Your help will be appriciated.

Regards,
Picbuster
 

nsaspook

Joined Aug 27, 2009
13,634
When using pic18f8722 or pic18f87k22 spi.h will be found (many of my application are using this)
and OpenSPI1(SPI_FOSC_64, MODE_11, SMPMID); works

Following the manual and procedures to set the pic
However ; pic18f6722 or pic18f67k22 fails.

I am able to find spi.h using the list but compiler/linker can't find it so OpenSPI1(SPI_FOSC_64, MODE_11, SMPMID); can't work.
But it does find SPI_FOSC_64 MODE_11 SMPMID
pic18f8722 and pic6722 (picF18 family) should be compatible and are printed on same datasheet.

I do not use mcc that's a pain and not working correctly.

I build my own SPI drivers but want to use Microchips spi.h
Does any body know how to solve this problem?

Your help will be appriciated.

Regards,
Picbuster
Confused about what software you are using. Is it C18 based or XC8?
 

nsaspook

Joined Aug 27, 2009
13,634
Hi Nsaspook,

I am using xc8 and all compilers from 1.34 to 2.xx producing this error.

Picbuster
Can you post/link a short program source/project that shows the problem. Sounds like more of a linker file issue. I have some 8722 board project code but it's old C18 based.
 

Thread Starter

Picbuster

Joined Dec 2, 2013
1,052
Hi,
Here relevant collection
#pragma config CCP2MX=0, WDTPS=8192, XINST=OFF,FCMEN=OFF,CCP2MX=0, IESO=OFF,
TRISC =0b00100000;
SSP1CON1bits.SSPEN1=1; // enable Spi1

#include <spi.h> //<== found and working for pic18f8722 pic18f87k22.

//found spi.h for pic18f6722 or pic18f67k22 but produced an error.
//Main.c:15:16: error: (141) can't open include file "spi.h": No such file or directory
// but spi.h was selected from include list table!! so it did exist.
// next step copy spi.h to source dir and load it same problem.
// you could be correct with you linker issue remark.

SSP1STAT= 0b1000000;
SSP1CON1bits.CKP=0;
SSP1CON1bits.SSPM=1; // 0=/4 1=/16 2=/64
PIE1bits.SSP1IE=0; // no int yet


OpenSPI1(SPI_FOSC_64, MODE_11, SMPMID); // error (open will set/overwrite SSPICON1bits )

while (1)
{
ReadRtc();
}

Picbuster
 
Top