View previous topic :: View next topic |
Author |
Message |
picj1984
Joined: 01 Mar 2010 Posts: 73
|
Trouble getting hardware SPI to work with #USE SPI |
Posted: Mon Mar 01, 2010 7:45 pm |
|
|
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
|
|
Posted: Mon Mar 01, 2010 8:35 pm |
|
|
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
|
|
Posted: Mon Mar 01, 2010 11:46 pm |
|
|
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
|
|
Posted: Tue Mar 02, 2010 3:19 am |
|
|
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! 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
|
thx! |
Posted: Tue Mar 02, 2010 2:51 pm |
|
|
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! |
|
|
|