Register Dump
Next step was to dump all registers (0x00 RegFifo thru 0x4F RegTemp2) of the RFM69HCW device.
/* Copyright ® 2019 May devMobile Software, All Rights Reserved MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE RegFiFo 0x00 thru RegPacketConfig2 0x3D */ namespace devMobile.IoT.Rfm69Hcw.RegisterScan { using System; using System.Diagnostics; using System.Threading.Tasks; using Windows.ApplicationModel.Background; using Windows.Devices.Spi; public sealed class Rfm69HcwDevice { private SpiDevice rfm69Hcw; public Rfm69HcwDevice(int chipSelectPin) { SpiController spiController = SpiController.GetDefaultAsync().AsTask().GetAwaiter().GetResult(); var settings = new SpiConnectionSettings(chipSelectPin) { ClockFrequency = 500000, Mode = SpiMode.Mode0, }; rfm69Hcw = spiController.GetDevice(settings); } public Byte RegisterReadByte(byte registerAddress) { byte[] writeBuffer = new byte[] { registerAddress }; byte[] readBuffer = new byte[1]; Debug.Assert(rfm69Hcw != null); rfm69Hcw.TransferSequential(writeBuffer, readBuffer); return readBuffer[0]; } } public sealed class StartupTask : IBackgroundTask { private const int ChipSelectLine = 0; private Rfm69HcwDevice rfm69HcwDevice = new Rfm69HcwDevice(ChipSelectLine); public void Run(IBackgroundTaskInstance taskInstance) { while (true) { for (byte registerIndex = 0; registerIndex <= 0x4F; registerIndex++) { byte registerValue = rfm69HcwDevice.RegisterReadByte(registerIndex); Debug.WriteLine("Register 0x{0:x2} - Value 0X{1:x2} - Bits {2}", registerIndex, registerValue, Convert.ToString(registerValue, 2).PadLeft(8, '0')); } Task.Delay(10000).Wait(); } } } }
I checked a selection of values from the Debug output and they matched the defaults in the datasheet e.g. 0x07-RegFrfMsb 0xE4, 0x08-RegFrfMid 0xC0, 0x09-RegFrfLsb 0x00, 0x2C-RegPreamble 0x0, 0x2D-RegPreamble 0x03 and 0x4E-RegTemp1 0x01.
Register 0x00 - Value 0X00 - Bits 00000000 Register 0x01 - Value 0X04 - Bits 00000100 Register 0x02 - Value 0X00 - Bits 00000000 Register 0x03 - Value 0X1a - Bits 00011010 Register 0x04 - Value 0X0b - Bits 00001011 Register 0x05 - Value 0X00 - Bits 00000000 Register 0x06 - Value 0X52 - Bits 01010010 Register 0x07 - Value 0Xe4 - Bits 11100100 Register 0x08 - Value 0Xc0 - Bits 11000000 Register 0x09 - Value 0X00 - Bits 00000000 Register 0x0a - Value 0X41 - Bits 01000001 Register 0x0b - Value 0X40 - Bits 01000000 Register 0x0c - Value 0X02 - Bits 00000010 Register 0x0d - Value 0X92 - Bits 10010010 Register 0x0e - Value 0Xf5 - Bits 11110101 Register 0x0f - Value 0X20 - Bits 00100000 Register 0x10 - Value 0X24 - Bits 00100100 Register 0x11 - Value 0X9f - Bits 10011111 Register 0x12 - Value 0X09 - Bits 00001001 Register 0x13 - Value 0X1a - Bits 00011010 Register 0x14 - Value 0X40 - Bits 01000000 Register 0x15 - Value 0Xb0 - Bits 10110000 Register 0x16 - Value 0X7b - Bits 01111011 Register 0x17 - Value 0X9b - Bits 10011011 Register 0x18 - Value 0X08 - Bits 00001000 Register 0x19 - Value 0X86 - Bits 10000110 Register 0x1a - Value 0X8a - Bits 10001010 Register 0x1b - Value 0X40 - Bits 01000000 Register 0x1c - Value 0X80 - Bits 10000000 Register 0x1d - Value 0X06 - Bits 00000110 Register 0x1e - Value 0X10 - Bits 00010000 Register 0x1f - Value 0X00 - Bits 00000000 Register 0x20 - Value 0X00 - Bits 00000000 Register 0x21 - Value 0X00 - Bits 00000000 Register 0x22 - Value 0X00 - Bits 00000000 Register 0x23 - Value 0X02 - Bits 00000010 Register 0x24 - Value 0Xff - Bits 11111111 Register 0x25 - Value 0X00 - Bits 00000000 Register 0x26 - Value 0X05 - Bits 00000101 Register 0x27 - Value 0X80 - Bits 10000000 Register 0x28 - Value 0X00 - Bits 00000000 Register 0x29 - Value 0Xff - Bits 11111111 Register 0x2a - Value 0X00 - Bits 00000000 Register 0x2b - Value 0X00 - Bits 00000000 Register 0x2c - Value 0X00 - Bits 00000000 Register 0x2d - Value 0X03 - Bits 00000011 Register 0x2e - Value 0X98 - Bits 10011000 Register 0x2f - Value 0X00 - Bits 00000000 Register 0x30 - Value 0X00 - Bits 00000000 Register 0x31 - Value 0X00 - Bits 00000000 Register 0x32 - Value 0X00 - Bits 00000000 Register 0x33 - Value 0X00 - Bits 00000000 Register 0x34 - Value 0X00 - Bits 00000000 Register 0x35 - Value 0X00 - Bits 00000000 Register 0x36 - Value 0X00 - Bits 00000000 Register 0x37 - Value 0X10 - Bits 00010000 Register 0x38 - Value 0X40 - Bits 01000000 Register 0x39 - Value 0X00 - Bits 00000000 Register 0x3a - Value 0X00 - Bits 00000000 Register 0x3b - Value 0X00 - Bits 00000000 Register 0x3c - Value 0X0f - Bits 00001111 Register 0x3d - Value 0X02 - Bits 00000010 Register 0x3e - Value 0X00 - Bits 00000000 Register 0x3f - Value 0X00 - Bits 00000000 Register 0x40 - Value 0X00 - Bits 00000000 Register 0x41 - Value 0X00 - Bits 00000000 Register 0x42 - Value 0X00 - Bits 00000000 Register 0x43 - Value 0X00 - Bits 00000000 Register 0x44 - Value 0X00 - Bits 00000000 Register 0x45 - Value 0X00 - Bits 00000000 Register 0x46 - Value 0X00 - Bits 00000000 Register 0x47 - Value 0X00 - Bits 00000000 Register 0x48 - Value 0X00 - Bits 00000000 Register 0x49 - Value 0X00 - Bits 00000000 Register 0x4a - Value 0X00 - Bits 00000000 Register 0x4b - Value 0X00 - Bits 00000000 Register 0x4c - Value 0X00 - Bits 00000000 Register 0x4d - Value 0X00 - Bits 00000000 Register 0x4e - Value 0X01 - Bits 00000001 Register 0x4f - Value 0X00 - Bits 00000000