View previous topic :: View next topic |
Author |
Message |
webgiorgio
Joined: 02 Oct 2009 Posts: 123 Location: Denmark
|
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Mon Dec 27, 2021 1:44 pm |
|
|
FWIW, CCS has four LoRa/LoRaWAN related files (dated 5/2020) in the
drivers directory but these are for the RN2903 module that requires a UART. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Tue Dec 28, 2021 4:04 am |
|
|
It is perfectly logical and sensible to translate the Arduino code, but you
would do that by using the native CCS functions (spi_xfer, not spi_read/
spi_write).
Rewrite the Arduino spi transfers to use the PIC functions, and then the rest
of the code would pretty much run 'as is'. Things you have to watch for
are the data sizes (remember a default integer in the Arduino is an int16). |
|
|
robertoemiliani
Joined: 10 May 2022 Posts: 1
|
Re: pic to pic with LoRa |
Posted: Tue May 10, 2022 2:54 am |
|
|
Hello everyone.
I have the same problem.
I must write a simple C-Code to interface two PIC microcontroller (PIC18F66K80) with two RFM95 radio module.
FSK or LoRa mode, for me it is no relevant.
I have not particular requirements.
I must send and receive only two byte between the microcontrollers.
The SPI works well, and I have no problem with it.
I need the list of set-up of radio module.
I have not found any application on the web.
ALL THE APPLICATIONS IN THE WORLD ARE ARDUINO BASED...
But I don't use Arduino platform (and I am happy).
The data sheet of RFM95 is very complex and it has'nt a simple tutorial or quick start guide.
Is there anyone that can send me a simple C-code example to help me?
Thanks in advance.
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Tue May 10, 2022 7:12 am |
|
|
The simple way is to just take the Ardunio C code, convert to CCS C code
or..
use Google to locate someone else's CCS C code... |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Tue May 10, 2022 10:07 am |
|
|
temtronic wrote: | The simple way is to just take the Ardunio C code, convert to CCS C code
or..
use Google to locate someone else's CCS C code... |
I have worked with LoRa and LoRaWAN for the last few years initially using the RFM96, then the RN2903 and these days, the more feature rich Seeed E5 modules.
LoRa and LoRaWAN are still early in their life cycle (immature) and are undergoing continuous enhancements which are not necessarily backward compatible. The RFM96 is a low level MAC layer device, this means, if you use this device, you should be expecting to upgrade the both the low level interface as well as the LoRaWAN stack for these devices including ones already deployed to the field. Is LoRa and LoRaWAN stack management something you really want to do?
An alternative is something like the Seeed E5 LoRaWAN modules which themselves are using an embedded STM32 which has the LoRa and LoRaWAN stack provided by STM in the processor. You can either program the STM32 natively or simply use AT commands for both LoRa and LoRaWAN applications. If changes need to be made to the stack, STM handle that - you still need to upgrade your code for devices in the field if required however this takes significantly less effort for a device developer than having to maintain the stack themselves. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Wed May 11, 2022 12:45 am |
|
|
And to reinforce what Asmallri has just said, the code to talk to the
intelligent controller, will be a few serial lines. The code to talk directly to
the Mac layer device will instead be thousands of lines. On smaller PIC's,
this is not going to be doable at all. On larger PIC's it is still going to use
a lot of ones available space, and even more time.....
Another comment. All the Lora stuff I know of is at heart 3.3v. You really
need to be using a 3.3v PIC to work with any of these units. Unreliability
and massive complexity result if you don't. The 5v Arduino piggyback
boards often rely on the fact that the Arduino inputs accept 2.4v as a
logic '1'. The PIC serial/SPI inputs do not. Result problems....
On the 'everything is Arduino' comment, this is simply untrue. There are
libraries for the Raspberry Pi as well (have used these). I have driven a
RFM95 with a PIC using Lora (much simpler for point to point than
LoraWan), with modified versions of the Pi libraries and SPI. However
even this was perhaps ten times as much code as using the smart
module. |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
|
|