brennan
Joined: 12 Mar 2007 Posts: 1
|
PIC Wizard 16F88 Setup SPI Bug |
Posted: Mon Mar 12, 2007 12:22 pm |
|
|
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 |
|