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

SPI and 16F687

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



Joined: 02 Dec 2005
Posts: 3

View user's profile Send private message

SPI and 16F687
PostPosted: Fri Dec 02, 2005 5:07 pm     Reply with quote

I am running version 3.238 of the CCS compiler from within MPLAB on a very simple test case of the SPI interface.

Code:

#include <16F687.H>
#fuses INTRC_IO, NOWDT, NOPROTECT, NOBROWNOUT, NOPUT
#use delay(clock=8000000)

//===============================
void main(void)
{

setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_4);

loop:
   spi_write(0x55);
   delay_us(100);
   goto loop;

}


When I execute the above via the MPLAB simulator the spi_write function never returns. It continuously loops looking for the Buffer Status Full bit to be set. More importantly the simulator does not show any activity on the SPI pins (PORTB & PORTC).

Is this a "feature" of the simulator?
Is this a "feature" of the compiler?

Thanks for any ideas or suggestions.

Phil
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Dec 02, 2005 5:42 pm     Reply with quote

See the Microchip forum:
http://forum.microchip.com/tm.asp?m=107506&mpage=1&key=spi&anchor#109773

http://forum.microchip.com/tm.asp?m=116484&mpage=1&key=spi&anchor#116484
philk



Joined: 02 Dec 2005
Posts: 3

View user's profile Send private message

PostPosted: Fri Dec 02, 2005 6:06 pm     Reply with quote

Ah yes, a simulator "feature". Now If I hadn't spent the last couple of hours on this I would be happier....

Thanks,
Phil
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