# DATA transmission/receiving using SCR Radio modules.

#### ericgibbs

##### Well-Known Member
hi C,
It was 'wrong' in the context of our chat about DIM's, not if you planned using all Const's for every address.
Const wr_regfifo = 0x80 'ADDRESS or 0x80
Const rd_regopmode = 0x01
Const wr_regopmode = 0x81
Const rd_regbitratemsb = 0x02
Const wr_regbitratemsb = 0x82

But you say OS doesn't allow Const for SPI. [ I have never tried]

E

#### camerart

##### Active Member
hi C,
It was 'wrong' in the context of our chat about DIM's, not if you planned using all Const's for every address.
Const wr_regfifo = 0x80 'ADDRESS or 0x80
Const rd_regopmode = 0x01
Const wr_regopmode = 0x81
Const rd_regbitratemsb = 0x02
Const wr_regbitratemsb = 0x82

But you say OS doesn't allow Const for SPI. [ I have never tried]

E
Hi Eric,
I re-tried CONST in OSH for the addresses and now it is working, which is neater. If I run out of space, I'll switch back to DIMs.
Thanks, C.

#### jjw

##### Member
Hi Eric,
I re-tried CONST in OSH for the addresses and now it is working, which is neater. If I run out of space, I'll switch back to DIMs.
Thanks, C.
Constants don't use any space in Ram
They are just replaced with their value when the program is compiled.

For example, these snippets are equivalent:
Code:
Costant one=1
Dim a as byte
a=one
End

........

Dim a as Byte
a=1
End

#### camerart

##### Active Member
Constants don't use any space in Ram
They are just replaced with their value when the program is compiled.

For example, these snippets are equivalent:
Code:
Costant one=1
Dim a as byte
a=one
End

........

Dim a as Byte
a=1
End
Hi JJW,
Ah, that's interesting!
I think OSH failed before because I tried to load an address (CONST) with a variable value (CONST)

Now I see that the value must be set as a CONST first, e,g, CONST TX = 3

Regarding address RegOpMode (See attached) TX = 3, but when using a CONST for TX, is it necessary to include all of the byte?

EDIT:Regarding the above question: All of the byte must be sent for any changes to the ADDRESS BYTE.
EDITEDIT: Just noticed, that I should have replied to JJW, now changed

C.

#### Attachments

• 78.5 KB Views: 61
Last edited:

#### camerart

##### Active Member
Hi,
See changed reference program in #1. I am now trying to get a LORA program working, after finding that most likely OOK will not be suitable for MORSE, so a more useful DATA TX/RX is the next challenge.
There are some differences in the reference program e,g, Reference to RFM69, sx1276 and an Arduino shield, which I will try to convert to SX1278-18LF2520.

I'm still struggling, so if any one has better conversion skills please chip in.

C.

#### camerart

##### Active Member
Hi,
I have just added a program in POST#1, that I have written with lots of help from other people's programs and notes, plus much more from this and other forums not forgetting the DATA sheet. (NOTE use the light blue LORA sections of it)
EDIT: Explanation moved to Post#1
Camerart.

Last edited:

#### ericgibbs

##### Well-Known Member
hi C,
IMO I would suggest that modifying and adding posts to your original post will not get others interested enough to scan back and forth thru the threads and following posts.
Eric

#### camerart

##### Active Member
hi C,
IMO I would suggest that modifying and adding posts to your original post will not get others interested enough to scan back and forth thru the threads and following posts.
Eric
Hi Eric,
I understand what you mean, but sometimes threads get long and the latest (in this case) program would get lost in the thread, so each attachment would need to be opened and studied to find the latest 'result'. (I follow a thread on a radio control forum, which is 1000s of posts long, and searching for the answer to your question takes an effort, and they do the same, I thought it was a good idea so I copied them)
Does this now seem sensible?
C.

#### ericgibbs

##### Well-Known Member
hi C,
Perhaps a thread on the members forum maybe a good idea, asking this question.

The downside to editing/modifying earlier posts is that the answers posted later by other members become meaningless.

E

#### camerart

##### Active Member
hi C,
Perhaps a thread on the members forum maybe a good idea, asking this question.

The downside to editing/modifying earlier posts is that the answers posted later by other members become meaningless.

E
Hi Eric,
In this particular case, I don't think there are many people interested, at least not until I get it going. I notice that a lot of people look at this page, but not many actually open the attachments, only the ones who can help with Oshonsoft, and looking at a working program will show anybody how each bit is done.
EDIT: I misunderstood your members lounge comment, I'll try that.
C.

Last edited:

#### camerart

##### Active Member
Hi, OOK MODE
I've now got a circuit working , and program...........................POSTED in #1
I've used a program, that uses the easiest method, of simply turning ON/OFF the radio, using the default frequency.
I'm still 'translating' a more complicated program (slowly)
C

Last edited:

#### camerart

##### Active Member
Hi, LORA MODE
Here is the program so far. I have translated it from some notes written in 'C' This program is written for LORA mode. [This program compiles, but is unfinished]

I have asked questions on other threads about detailed sections of the code, but I can't test the replies, till the program has been compiled and on a PIC in the complete circuit, then the radio module can export results to a screen for me to verify.
C.

#### Attachments

• 20.9 KB Views: 92
Last edited:

#### camerart

##### Active Member
Hi,
I've updated the program using Sagor's BIT BYTE suggestion from another thread.
I'm sure there are mistakes in the program, but it compiles, so now I should be able to work through it, 'in circuit'
I now have to understand how the FIFO works to finish.
I also realised that there needs to be an INPUT and OUTPUT from an external source for the radio module to SEND/RECEIVE
C.

#### Attachments

• 18.6 KB Views: 73

#### ericgibbs

##### Well-Known Member
hi C,
I have been looking online for you, trying to find an SX emulator or simulator, no luck so far.

Check these links for SX info.
E

Last edited:

#### camerart

##### Active Member
Hi E,
Some interesting stuff there.
I haven't quite figured out how to test it, but to see if the registers are working I can READ them and send the result to an LCD.
I use SDR# to see if there is transmission. Although I'm new to it.
Thanks, C

#### ericgibbs

##### Well-Known Member
I keep checking that BOTTOM link, I don't know why
hi C,
Do NOT clip on the last link!!!

DELETED It has Virus!!!!!!!

E

Last edited:

#### camerart

##### Active Member
hi C,
Do NOT clip on the last link!!!

DELETED It has Virus!!!!!!!

E
Hi E,
OK.
I hope you weren't tempted to click on the right hand column, they look like virus traps.
C.

#### ericgibbs

##### Well-Known Member
hi,
The Long Range 10k LoRa project... Don't go there!!!

I am still trying to fix my PC!!
E