Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DATA transmission/receiving using SCR Radio modules.

Status
Not open for further replies.
Hi Eric,
I'm speechless! Good job I can still type:) From:banghead::banghead::banghead: to :joyful::joyful::joyful:

I can now read and write, hurray.

Thanks once again, C.
 
Hi,
I've been trying to set the RegOpMode 0x01 REG ADDRESS of the SX1276
There is something limiting what values I can write. Here are all of the choices shown on the LCD READ. 0-4-8-12-16-80-64-192-128-132-136-140-144-148-152-156-208. (in the order shown) I don't see how bit 5 can be set to 00100000.
If I try a similar test, but this time setting the RegBitrateLsb 0x03 REG ADDRESS, I can WRITE/RECEIVE all 0=255 values.
Any ideas?
C.

Here is a section of the code:
 

Attachments

  • RegOpMode.txt
    1.1 KB · Views: 291
  • RegOpMode.jpg
    RegOpMode.jpg
    189 KB · Views: 294
hi,
As I recall you want OOK mode.?
Which means RegOpMode.7 = 0, so I would guess that all not valid bit patterns will not be accepted.

Please post the actual bit pattern you are trying to Write to the RegOpMode.

E
 
hi,
As I recall you want OOK mode.?
Which means RegOpMode.7 = 0, so I would guess that all not valid bit patterns will not be accepted.

Please post the actual bit pattern you are trying to Write to the RegOpMode.

E

Hi Eric,
Yes, I hope to try OOK first then PSK then hopefully LoRa, but that is ambitious.
I'm not sure quite how OOK works, but the dtata sheet reads that the Power amplifier is switchded on and off.
I'm not sue if RegOpMode is switched between standby and Transmit, or run in trnsmit, and switch the PA_LF or RFO_LF high low?

I'm guessing that SEND to the RegOpMode (Or any address) needs to be done as a byte, but if you think each bit could be set individually, this would be good. I'm trying lots of combinations.
C.
 

Attachments

  • RegOpMode.jpg
    RegOpMode.jpg
    116.4 KB · Views: 287
  • PA.jpg
    PA.jpg
    164 KB · Views: 289
I'm guessing that SEND to the RegOpMode (Or any address) needs to be done as a byte, but if you think each bit could be set individually, this would be good.

hi C,
The device expects a Byte for the Address followed by a Byte for the Data to be written to that Address.
If you want to see the Bits in a Byte, use

SPICSOn
SPISend %10000000' Write to an Address, Set Bits 0 thru 6, to suit the required Bit Address, the RED BIT 7, means this is a WRITE operation.
WaitUs 10
SPISend %00001111 ' Set Bits to suit the required Command
SPICSOff

I would strongly recommend that you decide which mode of operation you need for your application and focus on getting that working instead of trying combinations.

It is all in the SX1276 datasheet I have posted.

E
 
hi C,
The device expects a Byte for the Address followed by a Byte for the Data to be written to that Address.
If you want to see the Bits in a Byte, use

SPICSOn
SPISend %10000000' Write to an Address, Set Bits 0 thru 6, to suit the required Bit Address, the RED BIT 7, means this is a WRITE operation.
WaitUs 10
SPISend %00001111 ' Set Bits to suit the required Command
SPICSOff

I would strongly recommend that you decide which mode of operation you need for your application and focus on getting that working instead of trying combinations.

It is all in the SX1276 datasheet I have posted.

E
Hi Eric,
All understood, thanks.

I would have like to understand the more advanced LoRa modulation, but after asking for help in translating LoRa programs written in other languages on many forums, wasn't successful, I am learning the easier basic OOK, which will make a pair of Morse send/receivers. (I'm learning Morse) I can then try to learn the next type FSK. LoRa is very complicated.

I have asked for advice on the limited SEND choices mentioned above, from the writer of the program at #1. I think once this has been figured out things will fall into place.

Cheers, C.
 
Hi,
A bit of success:)
I tried all of the allowed SEND values, and noted that 0x00 and 0x04 turn the SX ON and OFF. (Others do also)
C.
 

Attachments

  • ON OFF.jpg
    ON OFF.jpg
    178.1 KB · Views: 270
hi,
Why are you learning Morse, when the TXR can work using standard Baud rate operation./ Pages 46/47 of the datasheet.?

Have you seen this link.?
https://software.intel.com/en-us/iot/hardware/sensors/sx1276-lora

E
Hi Eric,
Why learn Morse? I'm a radio HAM, and this is what some of us do.

I looked at your link, thanks, but I can only read write BASIC, and that with difficulty. I've looked at other code for hours, and it just doesn't go in:( although I can sometimes get clues.
C.
 
Why learn Morse? I'm a radio HAM, and this is what some of us do.

hi C,
I thought this Thread was related to SX1276 Data Transmission for the Tracker finder.??:rolleyes:

E
 
hi C,
I thought this Thread was related to SX1276 Data Transmission for the Tracker finder.??:rolleyes:

E
Morning Eric,
Ultimately it is, but I thought I would learn how the SX12xx work A to B.

First step OOK, which lends itself to Morse, with it's high power/distance ratio. Then I'll look at FSK which needs a computer, so even though I'm not so interested, others in my HAM club will find it interesting. Then LoRa, which as I've said is complicated, and I simply wouldn't be able to understand it without going through these stages first.

Using surface mount (New glasses arriving this week:wideyed:) I should be able make little radios and have Morse contact across my area.
C.
 
Hi,
After getting odd results up to now. I had a suggestion to check which radio Chip I have. This is done by reading the Register default values, and comparing different data sheets. After this test, I found that the radio chip is SX1231, not SX1276. I've added the PDF to #1
C.
 
Hi,
Just updated my program at #1 The CHIP/MODULE is switching ON/OFF and shows this on an SDRadio :woot:
C.
 
Hi,
I've established that when the SX1231 is in RX mode it shows it's transmitting, but when in Tx is isn't. Bit of a puzzle.
I'm guessing that getting it to transmit in TX mode, there are many settings to get correct.
Anyone have ideas?
C.
 
Hi,
I've established that when the SX1231 is in RX mode it shows it's transmitting, but when in Tx is isn't. Bit of a puzzle.
I'm guessing that getting it to transmit in TX mode, there are many settings to get correct.
Anyone have ideas?
C.

hi C,
When you say, when the SX1231 is in RX mode it shows it's transmitting, is ambiguous, could you explain in more detail how you checked the TX RX.?

Which mode of Transmission are you using.?

E
 
hi C,
When you say, when the SX1231 is in RX mode it shows it's transmitting, is ambiguous, could you explain in more detail how you checked the TX RX.?

Which mode of Transmission are you using.?

E
Hi Eric,
I've posted the TEST program in #1. RegDataModul set to OOK, Continuous...........RegPaLevel set to PA0 ON, POWER 31 (11111) ..............RegOpMode switched between TX and RX. When TX shown on LCD DATA=128 and shows nothing on SDR# (See image) RX shown on LCD=132 and shows a signal on SDR#
C.
 

Attachments

  • ONOFF.jpg
    ONOFF.jpg
    196.1 KB · Views: 255
Last edited:
hi C,

Refer these two images.
You ONLY OR the Reg Addresses for a Write Command, NOT the Data being Written to the Regs
E

Const regopmode = 0x01
Dim wregopmode As Byte
wregopmode = 0x01 Or 0x80 'Or 0x80 switches bit7 ON. This is needed to SPI change address value.

'DATA
Dim standbymode As Byte 'Including the rest of the byte
standbymode = 0x01 '%10000001
Dim fsmode As Byte 'Frequency synthesizer
fsmode = 0x82 '%10000010
Dim txmode As Byte '%10000011 ; Why is the TX mode Bit7 Set High.????
txmode = 0x83

Dim rxmode As Byte '%10000100
rxmode = 0x84

'ADDRESS
Const regdatamodul = 0x02 '0x48 '%01001000 6-5=11 Cont without. 4-3=01 OOK
Dim wregdatamodul As Byte
wregdatamodul = 0x02 Or 0x80
'DATA
Dim contookmode As Byte 'RegDataMode
contookmode = 0x68 '%01101000

'ADDRESS
Const regpalevel = 0x11
Dim wregpalevel As Byte
wregpalevel = 0x11 Or 0x80
'DATA
Dim pa0onpower31 As Byte 'Output power 31 =11111
pa0onpower31 = 0x9f

SPIPrepare
WaitMs 5000

mainloop:
'SPI=====================================================
SPICSOn
SPISend wregopmode 'RegOpMode
SPISend txmode 'TX MODE ; You are writing 0x83 to REG.
SPICSOff
 

Attachments

  • A01.gif
    A01.gif
    23.1 KB · Views: 259
  • A02.gif
    A02.gif
    29.4 KB · Views: 265
hi C,

Refer these two images.
You ONLY OR the Reg Addresses for a Write Command, NOT the Data being Written to the Regs
E

Const regopmode = 0x01
Dim wregopmode As Byte See below SPI
wregopmode = 0x01 Or 0x80 'Or 0x80 switches bit7 ON. This is needed to SPI change address value.

'DATA
Dim standbymode As Byte 'Including the rest of the byte
standbymode = 0x01 '%10000001
Dim fsmode As Byte 'Frequency synthesizer
fsmode = 0x82 '%10000010
Dim txmode As Byte '%10000011 ; Why is the TX mode Bit7 Set High.???? I only started this the day before, after misreading #43
txmode = 0x83

Dim rxmode As Byte '%10000100
rxmode = 0x84

'ADDRESS
Const regdatamodul = 0x02 '0x48 '%01001000 6-5=11 Cont without. 4-3=01 OOK
Dim wregdatamodul As Byte Same here
wregdatamodul = 0x02 Or 0x80
'DATA
Dim contookmode As Byte 'RegDataMode
contookmode = 0x68 '%01101000

'ADDRESS
Const regpalevel = 0x11
Dim wregpalevel As Byte Same here
wregpalevel = 0x11 Or 0x80
'DATA
Dim pa0onpower31 As Byte 'Output power 31 =11111
pa0onpower31 = 0x9f

SPIPrepare
WaitMs 5000

mainloop:
'SPI=====================================================
SPICSOn
SPISend wregopmode 'RegOpMode I added the 'w'regopmode because I was unable to simply use 'OR 0x80' (I thought this is the ADDRESS to be written to
SPISend txmode 'TX MODE ; and this is the DATA to be written to it) Is this incorrect?
SPICSOff

C.
 
hi C,
E

Const regopmode = 0x01 ' this is the Operating Mode Register of the Transceiver

Dim wregopmode As Byte
wregopmode = 0x01 Or 0x80' Setting Bit7 High means its a Write to Register command.

Dim txmode As Byte
txmode = 0x03 ' Transmit Mode,,, Frequency Synth and Transmitter Enabled

'example:
'Write to RegOpMode Reg

SPICSOn
SPISend wregopmode ' write to register address
SPISend txmode 'Frequency Synth and Transmitter Enabled
SPICSOff
 
Hi Eric,
I have changed the settings, and updated the OOK program in #1, back to a couple of days ago, so there is no added BIT.7s on the TX RX modes.
This is giving the same result. When it shows RX on the LCD, It shows a signal on SDR# When it shows TX on the LCD it shows nothing on SDR#.

Note: If I don't send anything, just switch on the SX1231, it shows a signal on the SDR# (RegOpMode default = STANDBY)

I think the SX1231 sometimes needs to be in STANDBY to change registers, so now I am trying a switch between STANDBY and instead of fixed settings written to RegOpMode this test will go through all of the DATA (DATA = DATA +1) choices, and I'll see what's shown on the LCD. [[I hope this is understandableo_O]]
C.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top