1. 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.
    Dismiss Notice

DATA transmission/receiving using SCR Radio modules.

Discussion in 'Oshonsoft' started by camerart, Oct 10, 2016.

  1. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,218
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    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 rd_regfifo = 0x00 '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
     
  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  3. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    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 (text):

    Costant one=1
    Dim a as byte
    a=one
    End

    ........

    Dim a as Byte
    a=1
    End
     
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.

    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.
     

    Attached Files:

    Last edited: Apr 14, 2017
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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: May 7, 2017
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,218
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    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
     
  9. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  10. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,218
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    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
     
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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: May 8, 2017
  12. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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: Jun 23, 2017
  13. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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]

    A link to the radio module SX1278 is on POST#1

    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.
     

    Attached Files:

    Last edited: Jun 23, 2017
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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.
     

    Attached Files:

  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,218
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    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

    Links DELETED, Virus, clears passwords!
     
    Last edited: Jun 26, 2017
    • Thanks Thanks x 1
  16. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    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
     
  17. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
  18. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,218
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi C,
    Do NOT clip on the last link!!!

    DELETED It has Virus!!!!!!!

    E
     
    Last edited: Jun 26, 2017
  19. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    OK.
    I hope you weren't tempted to click on the right hand column, they look like virus traps.
    What issues, was your clip talking about?
    C.
     
  20. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,218
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    The Long Range 10k LoRa project... Don't go there!!!:arghh:

    I am still trying to fix my PC!!
    E
     
  21. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,366
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Why "Don't go there"? Is it the virus you mentioned or the complication? It sounds like what I am trying to do.

    There are many similar projects, here's one: http://www.instructables.com/id/Arduino-Project-Test-Range-LoRa-Module-RF1276-for-/
    Trouble is they are mostly in Arduino, and as you will recall, I can't read it.
    C.
     

Share This Page