![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hi everyone,
i want some tutorials on spi in C.i am using two pic16f877a controllers.any simple tutorials like blinking leds.i have no concept of spi.please help me out if u guys have any information. Thanx |
|
|
|
|
|
|
(permalink) |
|
Thankx eng1.
I have already seen that file but i cant understand this.plz give me other links that r in C.i have no knowledge of assembly |
|
|
|
|
|
|
(permalink) |
|
__________________
Simran.. 8051 Specialist.. |
|
|
|
|
|
|
(permalink) |
|
Yes, there seams to be a lack of actual example code for SPI and if you can find some it's usually in asm. Here a some code written in C for Atmel.If anyone knows of more please share.
http://books.google.com/books?id=0vm...O3O0#PPA403,M1 |
|
|
|
|
|
|
(permalink) |
|
Here's the Master asm code (page 32 of this) in C18.
Code:
void main(){
unsigned char Count=0;
unsigned char Dummy;
TRISA=0;
ADCON1=0x06;
TRISC=0x10;
SSPSTAT=0x40;
SSPCON=0x31;
while(1){
LATAbits.LATA2=1;
SSPBUF=Count++;
while(!SSPSTATbits.BF);
Dummy=SSPBUF;
LATAbits.LATA2=0;
DelaymS(100);
}
}
Mike. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Hope that helps.. |
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| SPI Testing with ENC28J60 | mikesmixes777 | Micro Controllers | 9 | 17th January 2008 07:41 AM |
| DS1302 Real time clock questions, PIC18F2620 SPI mode and mcu memory usage | ssylee | Micro Controllers | 2 | 18th December 2007 06:37 AM |
| Both parallel and spi in PIC microcontroller PLEASE HELP | jitun2 | Micro Controllers | 12 | 24th October 2007 02:08 PM |
| Configuration Bits (Nigel's tutorials and Inchworm) | lpinkai | Micro Controllers | 7 | 23rd January 2007 05:38 PM |
| Tutorials for PIC? | falleafd | Micro Controllers | 14 | 7th July 2003 02:12 PM |