![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
pierokun
Joined: 18 Apr 2011 Posts: 1
|
interfacing between PIC18F and Transceiver CC1101 |
Posted: Mon Apr 18, 2011 4:06 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9174 Location: Greensville,Ontario
|
|
Posted: Mon Apr 18, 2011 5:03 am |
|
|
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! |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|