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

interfacing between PIC18F and Transceiver CC1101

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



Joined: 18 Apr 2011
Posts: 1

View user's profile Send private message

interfacing between PIC18F and Transceiver CC1101
PostPosted: Mon Apr 18, 2011 4:06 am     Reply with quote

hi everyone,

I need some help with my study project at University. I have to make interface between Microcontroller PIC18F and Transceiver CC1101, using CCS compiler C.
Now, I found a lot of datasheet about CC1101, some examples of sources code with other PIC or MCU, but i'm very blocked because of SPI interface.

Someone can help me please?! If I can't initialize SPI Pins, I couldn't communicate with CC1101.

I tried that :
Code:

#use spi(BAUD=9600,MASTER, DI=PIN_C4, DO=PIN_C5, CLK=PIN_C3, BITS=8, MSB_FIRST, MODE=0, ENABLE=PIN_A3)

and my definition of Pins is :

Code:
#define SCK PIN_C3   // is connected to SCLK of CC1101  <--> RC3/SCK/SCL of PIC18F
#define MISO PIN_C4    // is connected to SO of CC1101  <--> RC4/SDI/SDA of PIC18F
#define MOSI PIN_C5    // is connected to SI of CC1101  <--> RC5/SDO of PIC18F
#define CSn PIN_A3    // is connected to CSn of CC1101  <--> RA3 of PIC18F

I saw that some people use this:
Code:
 
setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_4 );

But don't know if it is good.

I'm really SAD. I try to visualize signal SCK or SO on oscilloscope, but nothing appears.

Please help........ :(

My thanks in advance.
temtronic



Joined: 01 Jul 2010
Posts: 9174
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 18, 2011 5:03 am     Reply with quote

CCS kindly supplies a few examples in the examples folder, which is a good place to start!
Your code of ...use spi(baud=9600...) is NOT how SPI is configured!
While SPI is a serial form a of communication, it's speed is not setup using baud=nnnn.
Again several examples of SPI are provided by CCS.
SPI is a very simple serial interface and the CCS functions make using it easy.
You should 'google', CCS C code and CC1101 to see if there are any 'hits'. Unless you're the very first one using the two, there's probably a few hundred or thousands of hits!
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