View previous topic :: View next topic |
Author |
Message |
yuripace
Joined: 26 Nov 2013 Posts: 21
|
|
Posted: Sun Jan 12, 2014 6:58 am |
|
|
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
|
|
Posted: Sun Jan 12, 2014 11:28 am |
|
|
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
|
|
Posted: Sun Jan 12, 2014 11:55 am |
|
|
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
|
|
Posted: Sun Jan 12, 2014 1:39 pm |
|
|
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
|
|
Posted: Mon Jan 13, 2014 11:57 am |
|
|
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
|
|
Posted: Mon Jan 13, 2014 4:48 pm |
|
|
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
|
|
Posted: Tue Jan 14, 2014 4:05 pm |
|
|
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!  |
|
 |
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Tue Jan 14, 2014 10:31 pm |
|
|
in what line and file this error happened? _________________ Eduardo Guilherme Brandt |
|
 |
yuripace
Joined: 26 Nov 2013 Posts: 21
|
|
Posted: Wed Jan 15, 2014 12:42 am |
|
|
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
|
|
Posted: Wed Jan 15, 2014 6:31 am |
|
|
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
|
|
Posted: Wed Jan 15, 2014 6:45 am |
|
|
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
|
|
Posted: Wed Jan 15, 2014 7:15 am |
|
|
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
|
|
Posted: Thu Jan 16, 2014 4:28 am |
|
|
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
|
|
Posted: Thu Jan 16, 2014 12:05 pm |
|
|
I'm very grateful you keep us updated about this error.
Thank you lot Mr. Yuri  _________________ Eduardo Guilherme Brandt |
|
 |
yuripace
Joined: 26 Nov 2013 Posts: 21
|
|
Posted: Sat Jan 18, 2014 11:07 am |
|
|
another update
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 |
|
 |
|