I have been looking at the Dorji DRF4463 as a replacement for the Hope RFM22B.
The new Dorji module uses the Si4463 versus the Si4432 used in the RFM22.
The newer Si4463 transceiver claims an extra 5dB of sensitivity at low data rates over the Si4432, so that should make line of sight operation at approx 70km using simple 1/4 wave antennas possible, assuming the extra sensitivity is realised in practice.
The interface from PICAXE to Si4463 is completely different to the register approach used for the Si4432, for which there are several working examples of PICAXE code published.
So the first thing to do after the Dorji modules arrived is to work out how, using the new API based interface to flash a a couple of LEDs attached to the GPIO pins.
This is the result, it works, and shows the basics of addressing the device.
The new Dorji module uses the Si4463 versus the Si4432 used in the RFM22.
The newer Si4463 transceiver claims an extra 5dB of sensitivity at low data rates over the Si4432, so that should make line of sight operation at approx 70km using simple 1/4 wave antennas possible, assuming the extra sensitivity is realised in practice.
The interface from PICAXE to Si4463 is completely different to the register approach used for the Si4432, for which there are several working examples of PICAXE code published.
So the first thing to do after the Dorji modules arrived is to work out how, using the new API based interface to flash a a couple of LEDs attached to the GPIO pins.
This is the result, it works, and shows the basics of addressing the device.
Code:
'DorjiSat.BAS
'Copyright Stuart Robinson - October 2013
#rem
This program is designed to test the basic interfacing of a PICAXE to the Dorji DRF4463 which uses the Si4463 RF chip.
The program initialises the Si4463, reads the internal part info then rapidly flashes two LEDs connected to GPIO0 and GPIO1.
If the Si4463 is initilaised and written to correctly the two LEDs should alternate flash very rapidly for 2 seconds
When the rapid flashing is finished, the GPIO0 LED will be off and GPIO1 LED should remain on for one second.
The GPIO1 LED should then go off and the sequence repeats.
Any deviation from the sequence indicates that the Si4463 is not being written to correctly.
Runs at 16Mhz and SPIFAST without needing to read the Si4463 CTS (busy) flag.
Details and pinouts of the Dorji DRF4463 are found here;
http://www.dorji.com/pro/Wireless-module/si4463_Module.html
The Si4463 API Command referance (AN625) is a critical document, but for some reason Si have chosen to hide it.
You wont find it on the documentation listed for the Si4463, so do a Google search for 'AN625 Si446XAPI DESCRIPTIONS'
#endrem
#PICAXE 28X2
#no_data
#no_table
symbol NSEL = a.1 'chip select line for DRF4463
symbol PXLED = a.3 'pin to drive LED on PCB
symbol SDN = A.0 'shutdown line for RFM22
symbol SCK = c.3
symbol var1 = b4 'General use variable
symbol var2 = b5 'General use variable
symbol var3 = b6 'General use variable
symbol var4 = b7 'General use variable
symbol var5 = b8 'General use variable
symbol Si4463Data = b20
symbol leddelay = b21
symbol loopv1 = b22
symbol wvar1 = w27
symbol si4463startupdelay = 1 'startup delay for Si4463 after SDN goes active
main:
high PXLED
pause 1000 'wait for terminal to be ready
sertxd("DorjiSAT - Stuart Robinson",CR,LF)
hspisetup spimode00,spimedium 'setup the SPI interface
high SDN 'ensure Si4463 is reset
pause 10
low SDN
pause si4463startupdelay 'there needs to be a delay here or the Si4463 fails to startup properly
low NSEL
HSPIout($02,$01,$00,$01,$C9,$C3,$80) 'power up sequence for Si4463 - needed
high NSEL
leddelay = 255
low PXLED
gosub displayversion
setfreq M16 'run at 16Mhz
loop1:
for loopv1 = 1 to 20
'Note that the full syntax for the API command GPIO_PIN_CFG would be HSPIout($13,3,2,0,0,0,0)
'partial commands appear to work, so only the first two bytes that configure GPIO0 and GPIO1 are sent.
'The parameters that configure GPIO2,GPIO3 (not used on DRF4464) and the NIRQ and SDO setup are not sent.
low NSEL
HSPIout($13,3,2) 'send API command to turn GPIO0 high,GIO1 low, drop rest of commands.
high NSEL
pause 50
low NSEL
HSPIout($13,2,3) 'send API command to turn GPIO0 low, GPIO1 high, drop rest of commands
high NSEL
pause 50
next loopv1
pause 2000 'leave LED on GPIO1 on for a while
low NSEL
HSPIout($13,2,2) 'both LEDs off
high NSEL
pause 2000
goto loop1
waitcts:
'checks the Si4463 CTS (busy) flag
do
low NSEL
HSPIout($44) 'command to check CTS
HSPIin(Si4463Data)
high NSEL
loop until Si4463Data = $ff 'if $FF is ready previous command has completed
return
waitCTSforread:
'this is used when retrieving data from the Si4463 and is different to a normal CTS
'check as NSEL is left low on exit
do
low NSEL
HSPIout($44) 'write out command to check CTS
HSPIin(Si4463Data)
if Si4463Data = $FF then 'if Si4463 is not busy then leave NSEL low and exit
exit
end if
high NSEL
loop until Si4463Data = $ff
return
displayversion:
'this demonstrates how to read from the Si4463, it performs the PART_INFO command
'retrieving 8 bytes of info from the Si4463, and should display 4463 as the part
gosub waitcts 'check if Si4463 is busy
low NSEL
HSPIout($01) 'start the PART_INFO command
high NSEL
gosub waitCTSforread 'check for busy, but leave NSEL low if not
ptr = 1 'ensure scrathpad pointr is at o
for loopv1 = 1 to 8 'there are 8 bytes to get
HSPIIN(Si4463Data) 'get the byte of PART_INFO
put loopv1, Si4463Data
next loopv1
high NSEL
sertxd("Si4463 Part_Info")
for loopv1 = 1 to 8 'there are 8 bytes to get
get loopv1, var1 'get the byte of PART_INFO
gosub hextoASCII
sertxd(",0x",var1,var2)
next loopv1
sertxd(CR,LF)
get 2, var1 'get first part of part number
gosub hextoASCII
sertxd("Reported Part Si",var1,var2)
get 3, var1 'get first part of part number
gosub hextoASCII
sertxd(var1,var2,CR,LF)
return
hextoASCII:
'converts var1 byte variable to 2 ASCII hex characters, ASCII characters returned in var1 and var2
var2 = var1 AND $0F 'isolate bottom nibble
if var2 < 10 then
var2 = $30 + var2
else
var2 = var2 + 55
endif
var3 = var1 AND $F0 'isolate top nibble
var3 = var3 / 16 'moves top 4 bits into bottom 4 bits
if var3 < 10 then
var3 = $30 + var3
else
var3 = var3 + 55
endif
var1 = var3
return
Last edited: