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 CCS Technical Support

PIC24FJ128GA010 and spi

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



Joined: 18 Dec 2009
Posts: 27

View user's profile Send private message Send e-mail

PIC24FJ128GA010 and spi
PostPosted: Tue Dec 22, 2009 11:47 pm     Reply with quote

Hi all
I am now working on spi and pic24fj128ga010.

I have run the sample code in mplab C30 compiler but now I want to program for explorer 16 board in CCS PIC C.

In Explorer 16 board spi is connected to eeprom.
Now how to program for that eeprom to read and write data?

Actually I am new to world of PIC and doing everything on my own.
Thats why I am facing alot of problems.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Dec 23, 2009 4:24 am     Reply with quote

For a SPI flash replacing the original EEPROM , I used the below settings on an Explorer16 board

Code:
#define SPI_CLK_DIV_2    0x001B
#define SPI_CKE          0x0100
#define SPI_CKP          0x0040
#define SPI_MODE_0 (SPI_CKE)
#define SPI_MODE_1 (0)
#define SPI_MODE_2 (SPI_CKP | SPI_CKE)
#define SPI_MODE_3 (SPI_CKP)

setup_spi2(SPI_MASTER | SPI_MODE_0 |SPI_CLK_DIV_2);


They should work with 25LC256 as well. As discussed in previous threads, it's the most simple method to use spi_read() for both read and write with PIC24.
salmankhalid16



Joined: 18 Dec 2009
Posts: 27

View user's profile Send private message Send e-mail

PostPosted: Thu Dec 24, 2009 1:21 am     Reply with quote

I am new to world of PIC.
I want some good tutorials on using spi and other peripherals in PIC by using CCS C compiler.

Can anyone tell me about some good website for it ?
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