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

nRF24L01+ full driver by Eduardo Guilherme Brandt
Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 18, 19, 20  Next
 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Sun Jan 12, 2014 6:58 am     Reply with quote

Eduardo__ wrote:
Dear Yuri,

You´ve to incluve nRF24L01P.C(main driver file), not nRF24L01P.h(definition drive), but you need both.


Code:
#include <nRF24L01P.C>           //Driver nRF24L01+   Single Chip 2.4GHz Transceiver Driver


you're right.. i changed it, added pin definition but error are the same :(
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Sun Jan 12, 2014 11:28 am     Reply with quote

you need to check, because this error means you´re defining something two times.
Theck the line numbers. Check if you copied correctly the driver from teh forum.
_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Sun Jan 12, 2014 11:55 am     Reply with quote

Seems some incompatibilities berween driver and 16f876.h include file. i'll check but i copied your drivers 2 times,so i dont think in a copy/past error
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Sun Jan 12, 2014 1:39 pm     Reply with quote

yes, you´re right Mr Yuri.

My suggestion is that you change in whole nRF driver(main file and header file) the word "tx_buffer_full" to "nRFtx_buffer_full".


Unfortunately C not offers incapsulation like C++. Things like that can happen. Sorry!
_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Mon Jan 13, 2014 11:57 am     Reply with quote

good! the last error now is this..
rv=spi_xfer(RF24_SPI, comm1, commDS);

error 27: expression must evaluate to a constant (with commDS underlined)

any ideas?

thanks for your help!!!
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Mon Jan 13, 2014 4:48 pm     Reply with quote

Look at CCS C help file. You will find:

Code:
spi_xfer(stream, data, bits)


bits was not mentioned. What function did you call that lead you to this error?
Have you tried use directly the function RF24_comm()???

If yes, you´re not placing correct parameters.
See the use of the function inside the driver:
Code:
int RF24_comm(int comm, int32 comm1, int commDS) {   //commDS=datasize(1 to 32 bits)



Begin trying using the driver like examples at the bottom of main driver file.
_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Tue Jan 14, 2014 4:05 pm     Reply with quote

this is the function with error

Code:
int RF24_comm(int comm, int32 comm1, int commDS) {   //commDS=datasize(1 to 32 bits)
   int rv;                             //rv=return value(SPI nRF24 status read value)
   RF24_select();       
   RF24_xfer(comm);                    //RF24 Write address/command(see RF24_addr addresses list tabble in .h file)
   rv=spi_xfer(RF24_SPI, comm1, commDS);//Write config.value or command(1 to 32 bits of data)___I CANNOT USE RF24_xfer() ALIAS BECAUSE IT NOT ACCEPTS MORE THAN 1 PARAMETER
 //rv=spi_read2();                     //It´s necessary due to spi_xfer read bug
   RF24_unselect();   
   return rv;                    //Return last read value
}


I'm not doing any test with the example. I simply included the nrf24l01p.c file and tried to compile all the project. Nothing else! Smile
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Tue Jan 14, 2014 10:31 pm     Reply with quote

in what line and file this error happened?
_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Wed Jan 15, 2014 12:42 am     Reply with quote

this line
Code:
rv=spi_xfer(RF24_SPI, comm1, commDS);//Write config.value or command(1 to 32 bits of data)___I CANNOT USE RF24_xfer() ALIAS BECAUSE IT NOT ACCEPTS MORE THAN 1 PARAMETER

file nRF24L01P.c (should be line 229)

thanks!
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Wed Jan 15, 2014 6:31 am     Reply with quote

Strange, I´ve no error. I use CCS C V4.124.

Have you used PASS_STRINGS=IN_RAM directive, like that:

Code:
#DEVICE *=16    ICD=TRUE  PASS_STRINGS=IN_RAM  HIGH_INTS=TRUE     

_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Wed Jan 15, 2014 6:45 am     Reply with quote

yes, this is all the (updated) include part
Code:

#include <16F876.h>
#device (PASS_STRINGS=IN_RAM)
#device (ICD=TRUE)

#use delay(clock = 16000000)
#fuses HS, NOPROTECT, NOPUT, NOWDT, NOBROWNOUT, NOLVP, NOCPD, NOWRT
#USE SPI(SPI2, MASTER, BAUD=1000000, MODE=0, BITS=8, MSB_FIRST, STREAM=RF24_SPI)

#define RF24_CS PIN_A1
#define RF24_CE PIN_A2
#define RF24_IRQ PIN_A3
#define SPI_MISO PIN_A4
#define SPI_MOSI PIN_A5
#define SPI_CLK PIN_B1

#include "flexlcd.c"
#include "1wire.c"
#include "nRF24L01P.c"

forgot: ccs v5.008:)
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Wed Jan 15, 2014 7:15 am     Reply with quote

I do not understand why is it happening. I've tested with several PICs like 18F26J11, 16f628, 16f876 and others with no errors.

Try to install an older compiler version to check.
Another thing is try to change this directive inside driver to check exactly this error.
_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Thu Jan 16, 2014 4:28 am     Reply with quote

you're right, with older ccompiler version (4.114) all compiles correctly.
I'll try later to check and try all the example and (most important) to check that all my project works also with v4 compiler instead of v5.

Thanks! I'll keep you update ;)
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Thu Jan 16, 2014 12:05 pm     Reply with quote

I'm very grateful you keep us updated about this error.

Thank you lot Mr. Yuri Wink
_________________
Eduardo Guilherme Brandt
yuripace



Joined: 26 Nov 2013
Posts: 21

View user's profile Send private message

PostPosted: Sat Jan 18, 2014 11:07 am     Reply with quote

another update Smile
I'm trying to communicate pifc16f876+nrf24l01 (with your driver) to a raspberry+nrf24l01 (with RF24lib, using this guide to configure and do a sample program http://hack.lenotta.com/arduino-raspberry-pi-switching-light-with-nrf24l01/).

I have 2 question:
1 - how can i check if the problem is on transmitting side (the pic) or the receiver (the raspberry)?
2 - how can i change transmission channel with your driver?

Thanks!!!

Yuri
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 18, 19, 20  Next
Page 12 of 20

 
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