RAK4260 Evaluation Board vs Microchip SAMR34 Xplained

I’m developing an application for the RAK4260 module using both a RAK4260 Evaluation Board and a Microchip SAMR34 Xplained Pro board.

Sample code from Microchip works on the Explained Board and sample code downloaded from RAK works on the RAK Evaluation Board. Unfortunately the same piece of code does not work on both development boards. When I load code which works on the Xplained board onto a RAK4260 Dev Board no packets show up on the gateway page. I haven’t checked with a spectrum analyser to see if the radio is transmitting or not.

Does anyone know the differences between the two development systems and why the same code does not work on both. I’m not worried about LEDs or similar, my interest is in the Lora Radio and the ability to send data packets.

I guess I’ll need to compare some code to see if I can spot the differences.

The hardware of RAK4260 is a little different from SAMR34 Xplained Pro board. The power of RF switch is controled by GPIO PA28 and the 32M TCXO is controled by GPIO PB03 to get lowest power consumption when it into sleep.So you need to set PA28 and PB03 to high when sending lora data.

1 Like

Thanks @hairui, now I know where to look in the code example from RAK.

Edited to correct details (thanks to @fishbeetle below) for pointing out my errors

For the record, the two development kits use different I/O pins to control the RF Switch and TCXO and as a result example code that runs on a Xplained board will not run on RAK4260 without some modification.

This is controlled in the file APPS_ENDDEVICE_DEMO1\src\ASF\sam0\boards\samr34_xplained_pro\samr34_xplained_pro.h
where you will find the following I/O pins defined.

TCXO chip
pin PA09 on the Xplained Board
pin PB03 on the RAK4260

RF Switch chip
Switching Pin
is PA13 on both boards
Power Pin
not switched, is hard wired to Vddana on the Xplained board
pin PB28 on the RAK4260

Also Note: PB28 is used as input Switch 0 on the Xplained Board

FYI the Xplained board schematic does NOT show PA13 controlling power to the RF switch. RFSwitch power is shown wired directly to Vddana while PA13 is shown connected to BAND_SEL on the RF switch. As indeed is the case on the RAK4260 module. BTW PA28 on the Xplained board is used for the user button input, again according to the published schematic.
Steve.

Hi Steve,

Do you have a link to the schematic as i’ll edit and correct my post.

From:
https://www.microchip.com/wwwproducts/en/ATSAMR34J18#additional-features
Look for: SAM R34 Chip-down Design Package 52397KB
You’ll be asked to log in.

1 Like

Hi
Seems the file is locked. I have signed in.
Anybody can share the file please.
[SAMR34 Reference Design Package]

Have you refreshed the page - I’ve just logged in, downloaded and unzipped/installed.

It is an exe for Windows (I’m sure that made sense to someone at Microchip) but it is there for you to access once registered with them.

As it requires registration, I’m not sure it’s very appropriate to share.

Hi Nick
Yes thanks did manage to download it.

Hey, are there any more changes to be done apart from these two changes if i want to use xplained pro code to rak4260? Kindly let me know… i have tried to also replicate the samr34_xplained_pro.h by the Github sample code from rak… but not able to send data…

Btw, my unit works with the default firmware given for the 4260…

I will add onto my question above… I have a few SAMR34 Xplained pro codes and i want to migrate it to RAK4260. However, just changing pin declarations does not work. Just to mention, my RAK4260 breakout module works flawlessly with the provided RAK firmware/code.

To convert my SAMR34 codes into RAK4260, i have done the following changes.

In board_init.c, Added:

/* Configure RFSWITCH SKY13373 PWR as output */
pin_conf.direction = PORT_PIN_DIR_OUTPUT;
port_pin_set_config(RFSW_PWR_PIN, &pin_conf);
port_pin_set_output_level(RFSW_PWR_PIN, RFSW_PWR_INACTIVE);

In samr34_xplained_pro.h, added and changed:

#define RF_SWITCH_PIN PIN_PA13
#define RF_SWITCH_ACTIVE true
#define RF_SWITCH_INACTIVE !RF_SWITCH_ACTIVE

#define RFSW_PWR_PIN PIN_PA28
#define RFSW_PWR_ACTIVE true
#define RFSW_PWR_INACTIVE !RFSW_PWR_ACTIVE

#define TCXO_PWR_PIN PIN_PB03
#define TCXO_PWR_ACTIVE true
#define TCXO_PWR_INACTIVE !TCXO_PWR_ACTIVE

To the radio_driver_hal.c, updated the TCXO function to include the RF switch power on, off, as given in http://www.marvellconsultants.co.uk/LoRaNode/index.html

void HAL_TCXOPowerOn(void)
{
port_pin_set_output_level(TCXO_PWR_PIN, TCXO_PWR_ACTIVE);
port_pin_set_output_level(RFSW_PWR_PIN, RFSW_PWR_ACTIVE); // also enable RF switch
delay_ms(RADIO_CLK_STABILITATION_DELAY);
}
void HAL_TCXOPowerOff(void)
{
port_pin_set_output_level(TCXO_PWR_PIN, TCXO_PWR_INACTIVE);
port_pin_set_output_level(RFSW_PWR_PIN, RFSW_PWR_INACTIVE);
}

Do i need to do any other changes? This does NOT work for me, and my RAK4260 cannot do OTAA. I tried with ABP, and it works! So i presume it is the RF switch that is not able to give a downlink to the R34 module.

Cant understand why did RAK have to change the pin config of the 4260 module, when compared to the Xplained pro board! :frowning: All the Microchip examples would have been a straight forward fit if the pins had been the same.

Someone, please help!

Did you manage to solve this??