25 Sep 2002 14:06
Re: [PIC]: ASM in Hi-Tech C error
Howdy,
I had issues using the SPI port as well. From memory I had to read the
SSPBUF register first (even though the data was meaningless) using "movf
SSPBUF, W", then I was able to write to the register without causing a
write collision. My application was entirely in assembly however so I'm
not sure about the compiler your using. Oh by the way this was using a
PIC18F452, I'm not sure about other models with SPI interfaces.
Sincerely
Damien Cahill
At 10:34 AM 25/09/2003 +0100, you wrote:
>Hi, I'm trying to embed some assembler into my Hi-Tech C code as a little
>experiment, but I keep getting an error.
>
>The line of code is:
>
> asm("CLRF SSPBUF,0");
>
>The error is:
>
>Error[000] C:\Develop\CR900Controller\SPI.h 51 : syntax error
>
>If I use this line of code, all is fine:
>
>asm("NOP");
>
>Does anyone have any ideas what I'm doing wrong? I've looked through the
(Continue reading)
RSS Feed