SPI code example needed for PIC microcontroller?

Status
Not open for further replies.

elrayes

Full Member level 5
Joined
Jun 3, 2008
Messages
244
Helped
20
Reputation
40
Reaction score
7
Trophy points
1,298
Location
Egypt/Canada
Visit site
Activity points
2,777
pic spi example

Hi all

I need an example code for SPI interface for PIC microcontroller using C18 compiler, if you have a code working please post it, i don't need it for college project but i'm facing some problems with SPI interface and need a reference code to follow.

Thanks in advance
 

spi code for pic

Actually, I have the same question.

Specifically, I have read through the examples given, and I was wondering if there is common syntax for the C18 compiler for the following:

1) SPI read(char)
2) SPI write(char)

I ask because I see several commands in the postings, but I am unsure if they are standard, or written in code not shown there. I just need to send bytes of data to an external device using SPI interface.

Does anyone know of an API which has commands useful to micro-controllers using the C18 compiler?

I just need some simple commands, I can initialize the registers and SPI mode myself from the PIC datasheet.

Thanks in advance
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…