+ Reply to Thread
Page 3 of 3 FirstFirst 123
Results 81 to 102 of 102
  1. #81
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    I've noticed that the follwing does nothing to the program as it is

    nothing could be further from the truth

    rfm: is a label that points to the memory location that holds the config data
    GLetAddress label defines the macro that pbp will use to locate the address of rfm
    SETMODE?C label defines the macro for the pbp usercommand setmode
    Last edited by richard; - 26th March 2019 at 21:36.
    This is more entertaining than Free to Air TV

  • #82

    Default Re: Programming RFM radio modules in Basic

    Richard,

    I have a question. As the program is like this right now, doesnt need at all the following lines.

    Code:
    goto overrfm  ; this is the rfm69 engine there is nothing here for users EXCEPT :-
    ;SEE COMMENTS WHERE NOTED FOR PIC16 USE AND NON H TYPE MODULES
    ;IF YOUR CHIP CANNOT READ ITS FLASH MEMORY OR HAS NO MSSP MODULE TOO BAD
    ;IF YOUR CHIP HAS MULTIPLE MSSP MODULES YOU MAY NEED TO MAKE A FEW TWEAKS RE MSSP REGISTER NAMES
    rfm:
    asm
     dw 0x0104,0x0200,0x0306,0x0483,0x0503,0x06d7,0x076c,0x0840
     dw 0x0900,0x131a,0x1942,0x2540,0x29dc,0x2c00,0x2d05,0x2e90  
     dw 0x2fde,0x30ad,0x3166,0x3734,0x3811,0x3904,0x3a01,0x3C8c
     dw 0x6F30 ;NOT FOR PIC16   REM OUT  THIS LINE
    
    GLetAddress macro Label, Wout
        CHK?RP Wout
        movlw low Label          ; get low byte
        movwf Wout
        movlw High Label         ; get high byte
        movwf Wout + 1  
        BANKSEL 0
        endm 
    SETMODE?C  macro MODE
        MOVE?CB  MODE ,_r69_mode     
        L?CALL _r69SetMode   
      endm  
        
     endasm
    also the label
    Code:
     overrfm
    in the inc file doesnt have anything under it.

    From the main pbp master or slave program, nowhere the overrfm is called or the rfm.

    Please tell me if i undetstand well. Before i use your tip, resetting the radio module, the program didnt work.

    Once i placed the following lines in Master and Slave

    Code:
    ;-----------------------------------------| 
    ;  from PIC to Reset pin at radio module  |
    ;-----------------------------------------|
    high PORTC.0
    pauseus 100
    low PORTC.0
    
    pause 5
    and also linked by a wire the PORTC.0 from the PIC to Reset on the Radio module, the program worked.

    I did a test by removing the wire from one of the PORTC.0 from master or slave, during the two boards were working, and noticed that both radios stopped to communicate each other.

    Why this happened as resetting both radios via software, they still need to know that reset is at a low state.

    That tells me that the Radios doens like to have a high RST at all times, and they only like this pin to be low.

  • #83

    Default Re: Programming RFM radio modules in Basic

    So i didnt one more test.

    I only left the following line regarding the RST funtionality, as the RST it is held high by itself.

    Code:
    low PORTC.0
    pause 5
    and it worked. But once again, when i remove the wire from the PORTC.0 from one of the Master or Slave , radios stop communicating, even if i place back the wire during they are plugged in power.

    Only if i reset physically the power, communcation is established.

  • #84
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    I have a question. As the program is like this right now, doesnt need at all the following lines.
    try it ,it would not even compile let alone function.
    i have given an explanation , for you the include file is a black box , if you don't understand it leave it alone , make changes at your peril


    comments like this are a wasted effort ,just a typing exercise. there is no information of worth in any of it , its far better to read the data sheet if you need to know anything
    ie RegOpMode 0x04 standby , what about the rest of the modes we use and don't use , other regs will change before the init routine has finished so it not even the final state.
    its just pointless and incomplete and useless

    Code:
    ;___________________________________ _________________________________________________________________________________|
    ;        |       |                  |       |                                              |                          |   
    ;  dw    |ADDRESS|    Reg Name      | Value |                 Description                  |        Notes             |
    ;________|_______|_________________ |_______|______________________________________________|__________________________|
    ;0x0104 :  0x01  |   RegOpMode      | 0x04  |  Operating modes of the transceiver          |  (Standby mode (STDBY)   |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x0200 :  0x02  |   RegDataModul   | 0x00  |  Data operation mode and Modulation settings |                          |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x0306 :  0x03  |   RegBitrateMsb  | 0x06  |  Bit Rate setting, Most Significant Bits     |  BitRate (15:8) 19.2kbps |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x0483 :  0x04  |   RegBitrateLsb  | 0x83  |  Bit Rate setting, Least Significant Bits    |  BitRate (7:0)  19.2kbps |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x0503 :  0x05  |   RegFdevMsb     | 0x03  |  FreqDeviation setting Most Significant Bits |    0x03   60000 (Hz)     |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x06d7 :  0x06  |   RegFdevLsb     | 0xD7  |  FreDeviation setting Least Significant Bits |    0xD7   60000 (Hz)     |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x076c :  0x07  |   RegFrfMsb      | 0x6C  |  RF Carrier Frequency, Most Significant Bits |    0x6C   433   (Mhz)    |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x0840 :  0x08  |   RegFrfMid      | 0x40  |  RF Carrier Frequency, Intermediate Bits     |    0x40   433   (Mhz)    |
    ;_____________________________________________________________________________________________________________________|
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x0900 :  0x09  |   RegFrfLsb      | 0x00  |  RF Carrier Frequency Least Significant Bits |    0x00  433   (Mhz)     |
    ;---------------------------------------------------------------------------------------------------------------------|
    ;0x131a :  0x13  |   RegOcp         | 0x1A  |  Over Current Protection control             |    0x1A RegOCP is ON     |
    ;---------------------------------------------------------------------------------------------------------------------|

    Please tell me if i undetstand well. Before i use your tip, resetting the radio module, the program didnt work.
    it was not a tip but a warning . the reset pin is tricky


    you will need to consult the adafruit docs re reset pin connection and state , my modules let it float
    hope data sheet indicates its necessary to drive it high to reset, nothing indicates a connection is needed if pin unused.
    the adafruit module may need different treatment for this pin ,i know nothing about them
    This is more entertaining than Free to Air TV

  • #85
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    Only if i reset physically the power, communcation is established.
    if thats the case then just connect reset pin to ground (must be the logic level converter holding pin high when floating ), simply rely on power on reset like i do
    we don't need it.
    This is more entertaining than Free to Air TV

  • #86

    Default Re: Programming RFM radio modules in Basic

    Thanks Richard, i will keep the RST low via software.

    to be honest i do not understand fully the code but i undesrtand overal what evey step does and it is very informative. Thanks for the help.

    Now i would like to test simple things.

    In the datasheet, it is mentioned that Node must be different from the Master to any of the slaves.

    the Networkaddress must be the same, as both of the modules must be in the same network.

    Can we change the network just to see if it is working or not?

  • #87
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    i will refer you to the include header for this simple two node demo, two nodes with the same address in a two node network is perfectly acceptable
    Code:
    '****************************************************************
    '*  Name    : R69.BAS                                           *
    '*  Author  : RICHARD                                           *
    '*  Notice  : Copyright (c) 2019                                *
    '*          : THIS CODE IS NOT CLAIMED TO BE IN ANY WAY         *
    '*          : COMPLIANT WITH RF EMISSION REGULATIONS ANYWHERE   *
    '*          : ON THIS PLANET OR TO BE FIT FOR ANY PURPOSE       *
    '*  Date    : 3/23/2019                                         *
    '*  Version : 1.0                                               *
    '*  Notes   : SIMPLE RFM69 FIXED NODE/PAYLOAD LEN               *
    '*          : NODE=4 BCAST=1    434MHZ                          *
    '****************************************************************
    the node address is fixed the network address is fixed the payload length is fixed as is carrier freq / bw /dev / baud rate for the demo
    if you change any one of these parameters the nodes will not communicate. unless both nodes are identical they don't talk to each other

    also if you change the payload length the demo will fail unless the code is modified to compensate , if the on chip fifo is exceeded then
    a different approach must be taken, it needs to be interrupt driven ,polling won't work

    i see no point in messing with any of these settings , it would serve no purpose
    This is more entertaining than Free to Air TV

  • #88

    Default Re: Programming RFM radio modules in Basic

    i did comment the following

    Code:
    '****************************************************************
    '*  Name    : R69.BAS                                           *
    '*  Author  : RICHARD                                           *
    '*  Notice  : Copyright (c) 2019                                *
    '*          : THIS CODE IS NOT CLAIMED TO BE IN ANY WAY         *
    '*          : COMPLIANT WITH RF EMISSION REGULATIONS ANYWHERE   *
    '*          : ON THIS PLANET OR TO BE FIT FOR ANY PURPOSE       *
    '*  Date    : 3/23/2019                                         *
    '*  Version : 1.0                                               *
    '*  Notes   : SIMPLE RFM69 FIXED NODE/PAYLOAD LEN               *
    '*          : NODE=4 BCAST=1    434MHZ                          *
    '****************************************************************
    ' listen   con $10
    ' standby  con 4
    ' BCAST    CON 1
    ' NODE     CON 4
    vars the engine needs
    r69_sdata  var byte  ;BYTE DATA
    r69_tmpa   var word  ;TEMPORARY STORE
    r69_tmpb   var word  ;CMD
    r69_mode   var byte
    r69_rxflg  var byte  ; >0 THEN MESSAGE OR BCAST MESSAGE
    r69_i      var byte  ;INDEX
    r69_dest   var byte  ;DEST
    r69_buff   var byte[35]  ;BUFFER
    
    ';the r69 pins that we use along with sdi,sdo,sck
    ';sdi=miso sdo=mosi 
    'r69_int    var portc.1    ;dio0
    'r69_cs     var lata.5     ;nss
    USERCOMMAND "SETMODE"     ;LISTEN OR STANDBY
    ;USERCOMMAND "SETPOWER"    ;PWR 0-31
    ;USERCOMMAND "SETDEST"    ;NODE OR BCAST
    
    
    
    goto overrfm  ; this is the rfm69 engine there is nothing here for users EXCEPT :-
    ;SEE COMMENTS WHERE NOTED FOR PIC16 USE AND NON H TYPE MODULES
    ;IF YOUR CHIP CANNOT READ ITS FLASH MEMORY OR HAS NO MSSP MODULE TOO BAD
    ;IF YOUR CHIP HAS MULTIPLE MSSP MODULES YOU MAY NEED TO MAKE A FEW TWEAKS RE MSSP REGISTER NAMES
    'rfm:
    'asm
    ' dw 0x0104,0x0200,0x0306,0x0483,0x0503,0x06d7,0x076c,0x0840
    ' dw 0x0900,0x131a,0x1942,0x2540,0x29dc,0x2c00,0x2d05,0x2e90  
    ' dw 0x2fde,0x30ad,0x3166,0x3734,0x3811,0x3904,0x3a01,0x3C8c
    ' dw 0x6F30 ;NOT FOR PIC16   REM OUT  THIS LINE
    
    'GLetAddress macro Label, Wout
    '    CHK?RP Wout
    '    movlw low Label          ; get low byte
    '    movwf Wout
    '    movlw High Label         ; get high byte
    '    movwf Wout + 1  
    '    BANKSEL 0
    '    endm 
    'SETMODE?C  macro MODE
    '    MOVE?CB  MODE ,_r69_mode     
    '    L?CALL _r69SetMode   
    '  endm  
        
    ' endasm
    and it complied just fine and worked as before. I'm really confused.

  • #89
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    I'm really confused.
    more like deluded

    you cannot have "edited" the actual file thats getting compiled .
    you must have multiple copies

    you shoud get
    [ASM ERROR] MASTER.ASM (254) : Illegal opcode (_standby)
    [ASM WARNING] MASTER.ASM (254) : Found label after column 1. (SETMODE?C)
    [ASM ERROR] MASTER.ASM (330) : Illegal opcode (_standby)
    [ASM WARNING] MASTER.ASM (330) : Found label after column 1. (SETMODE?C)
    [ASM ERROR] MASTER.ASM (430) : Illegal opcode (_rfm)
    [ASM WARNING] LMASTER.ASM (430) : Found label after column 1. (GLetAddress)
    [ASM ERROR] MASTER.ASM (632) : Illegal opcode (_standby)
    [ASM WARNING] MASTER.ASM (632) : Found label after column 1. (SETMODE?C)
    [ASM ERROR] MASTER.ASM (718) : Illegal opcode (_listen)
    [ASM WARNING] MASTER.ASM (718) : Found label after column 1. (SETMODE?C)
    [ASM ERROR] MASTER.ASM (759) : Illegal opcode (_listen)
    [ASM WARNING] MASTER.ASM (759) : Found label after column 1. (SETMODE?C)
    This is more entertaining than Free to Air TV

  • #90

    Default Re: Programming RFM radio modules in Basic

    i'll try that.

    I might understand what happen. When i save the file to the destination folder in PBP, it is not possible to save the file there as it doesnt let you change any file in there.

    What i need to do is to save the file outside and then copied there.

    Let me do that and i will let you know results.

    Thanks once again.

  • #91

    Default Re: Programming RFM radio modules in Basic

    I created a file outside the pbp folder and transfered the file to the folder i use for the inc files.

    I was getting errors when i commented the rfm: and the rest of the asm code.

    Then i did an other test and tried to change the node to 5 and didnt work.Then i made it 4 again and it worked.

    I though that nodes can be different. Only the Network must be the same.

  • #92
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    I though that nodes can be different. Only the Network must be the same
    again i will refer you to the include header for this simple two node demo, two nodes with the same address in a two node network is perfectly acceptable.

    the code as it stands will not support multiple destinations, it is what it is

  • #93
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    Quote Originally Posted by richard View Post
    I have developed libraries for pic, Arduino and raspberry_pi's [python2.7] to all yak to each other with rfm69 modules [rfm12b also] but
    they are complex ,undocumented and beyond my resources to support for novices
    as indicated from the start of this thread its a complex subject, its beyond my resources and not my intent to support the myriad of ways a rfm69 module can be employed . i have demonstrated one way.
    all my "real code" that exploits additional functionality is now C based. the pbp stuff is legacy code, additional functions are added in an adhoc fashion as needs arise.

    you are yet to demonstrate that you can employ the existing functionality of this include library as it stands . lets not get ahead of ourselves
    This is more entertaining than Free to Air TV

  • #94

    Default Re: Programming RFM radio modules in Basic

    thanks for that Richard. I will try to find a solution to my project. Your help is much appreciated.

  • #95
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    updated schematic to show reset connection on adafruit modules , these modules have reset pulled high (active) for no useful reason.
    the pin needs to be held low for normal operation on their modules.
    This is more entertaining than Free to Air TV

  • #96

    Default Re: Programming RFM radio modules in Basic

    thanks Richard,

    i have done that via software. Connected one oin from pic to radio module and made the port low.

  • #97
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    i have done that via software. Connected one oin from pic to radio module and made the port low.
    as long as you realise there is no need to waste a pin on it , it won't be used
    This is more entertaining than Free to Air TV

  • #98

    Default Re: Programming RFM radio modules in Basic

    yes that is true. i will short it to ground as on the schematic.

  • #99
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    leo , are you making any progress with the rfm modules ?
    This is more entertaining than Free to Air TV

  • #100

    Default Re: Programming RFM radio modules in Basic

    Hi Richard,

    it is a period with lots of work, seminars and congresses. Havent touched it for a while.

    I had to do a major 3D design project for Medronic.

  • #101
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Programming RFM radio modules in Basic

    thats ok, i was so taken by the simplicity of this method that i have adopted it entirely and abandoned all the rfm12 modules. i have just finished converting my home rfm network to this new format and i thought if you were still active on this i would keep my breadboard setup intact .
    This is more entertaining than Free to Air TV

  • #102

    Default Re: Programming RFM radio modules in Basic

    Thanks a lot Richard, i wish i could be close to you to learn lots from you and to see the rfm network.

    This is a very busy period for me.

  • Similar Threads

    1. basic pic programming
      By sshanmugapriya in forum mel PIC BASIC
      Replies: 0
      Last Post: - 25th February 2010, 05:02
    2. Car radio (Car radio and electronics support forum)
      By freewillover in forum Forum Requests
      Replies: 1
      Last Post: - 1st July 2009, 19:41
    3. Smart Radio RF620A and RF620RA modules
      By Colin612 in forum Serial
      Replies: 0
      Last Post: - 8th May 2008, 15:47
    4. LPRS/miniature radio modules
      By fowardbias in forum Off Topic
      Replies: 1
      Last Post: - 20th September 2005, 01:03
    5. Help With Easy Radio Modules
      By hughgoodbody in forum General
      Replies: 5
      Last Post: - 25th May 2005, 09:14

    Members who have read this thread : 33

    You do not have permission to view the list of names.

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts