This commit is contained in:
David Westgate 2025-04-10 13:50:18 -07:00
parent 58ba467538
commit 86d30c02ec
5 changed files with 55 additions and 18 deletions

View File

@ -4,8 +4,10 @@ A multi-function application designed to run on a pi node. When used in a mesh n
The implementation here uses CC2500 register values which intend to mimic my [Girafus M07A](https://www.girafus.com/en-en/collections/peilsender/products/ersatzteil-basismodul-fur-girafus%C2%AE-pro-track-tor-katzen-hunde-haustier-kleintier-sucher) unit. This unit is paired with my associated [tracker](https://www.girafus.com/en-en/collections/peilsender/products/extra-sender-tag-fur-den-girafus%C2%AE-pro-track-tor-haustier-hund-katze-kleintier-finder-sucher-ortung) The implementation here uses CC2500 register values which intend to mimic my [Girafus M07A](https://www.girafus.com/en-en/collections/peilsender/products/ersatzteil-basismodul-fur-girafus%C2%AE-pro-track-tor-katzen-hunde-haustier-kleintier-sucher) unit. This unit is paired with my associated [tracker](https://www.girafus.com/en-en/collections/peilsender/products/extra-sender-tag-fur-den-girafus%C2%AE-pro-track-tor-haustier-hund-katze-kleintier-finder-sucher-ortung)
## CC2500 datasheet ## Links
[cc2500.pdf](./cc2500.pdf) * [Arduion Forum Port](https://forum.arduino.cc/t/replicating-a-signal-from-a-locating-device-2-4ghz-to-locate-tag/321993/2)
* [cc2500 data sheet](./cc2500.pdf)
* [C Code transciever example](https://github.com/alexbirkett/cc2500-raspberry-pi)
## CC2500 to Raspberry Pi GPIO Pin Mapping ## CC2500 to Raspberry Pi GPIO Pin Mapping
@ -73,21 +75,38 @@ The known frequency range is 2400 2483.5 MHz, and my SDR has a 20 MHZ bandwi
| 3 | 2450 MHz | 2,450,000 kHz | 2440 2460 MHz | 2,440,000 2,460,000 kHz | | 3 | 2450 MHz | 2,450,000 kHz | 2440 2460 MHz | 2,440,000 2,460,000 kHz |
| 4 | 2470 MHz | 2,470,000 kHz | 2460 2480 MHz | 2,460,000 2,480,000 kHz | | 4 | 2470 MHz | 2,470,000 kHz | 2460 2480 MHz | 2,460,000 2,480,000 kHz |
| 5 | 2483.5 MHz | 2,483,500 kHz | 2473.5 2483.5 MHz | 2,473,500 2,483,500 kHz | | 5 | 2483.5 MHz | 2,483,500 kHz | 2473.5 2483.5 MHz | 2,473,500 2,483,500 kHz |
#### Signal 00
2.423257000 GHz | 2423.257000 MHz | 2423257.000 kHz |
![signal_00](./images/signals/signal00.png)
#### Signal 0 #### Signal 0
2.431258000 GHz | 2431258.000 kHz 2.431258000 GHz | 2431.258000 MHz| 2431258.000 kHz
![signal_0](./images/signals/signal0.png) ![signal_0](./images/signals/signal0.png)
#### Signal 1 #### Signal 1
2.447257000 GHz | 2447257.000 kHz 2.447257000 GHz | 2447.257000 MHz | 2447257.000 kHz
![signal_1](./images/signals/signal1.png) ![signal_1](./images/signals/signal1.png)
#### Signal 2 #### Signal 2
2.450225000 GHz | 2450225.000 kHz 2.450225000 GHz | 2450.225000 MHz | 2450225.000 kHz
![signal_2](./images/signals/signal2.png) ![signal_2](./images/signals/signal2.png)
#### Signal 3 #### Signal 3
2.471275000 GHz | 2471275.000 kHz 2.471275000 GHz | 2471.275000 MHz | 2471275.000 kHz
![signal_2](./images/signals/signal2.png) ![signal_2](./images/signals/signal2.png)
#### Signal Summary #### Signal Summary
🧩 Final Answer
Base frequency: 2431258 kHz
Channel spacing: 500 kHz
Signal channels:
Signal 0 → Channel 0
Signal 1 → Channel 16
Signal 2 → Channel 18
Signal 3 → Channel 40
## Run ## Run

View File

@ -1,15 +1,12 @@
{ {
"IOCFG2" : { "hex":"0x0B", "dec":11}, "IOCFG0" : { "hex":"0x06", "dec":6},
"IOCFG0" : { "hex":"0x0C", "dec":12}, "PKTCTRL0": { "hex":"0x05", "dec":5},
"PKTCTRL0": { "hex":"0x12", "dec":18},
"CHANNR" : { "hex":"0x7D", "dec":125},
"FSCTRL1" : { "hex":"0x0A", "dec":10}, "FSCTRL1" : { "hex":"0x0A", "dec":10},
"FREQ2" : { "hex":"0x5C", "dec":92}, "FREQ1" : { "hex":"0x20", "dec":32},
"FREQ1" : { "hex":"0x4E", "dec":78}, "FREQ0" : { "hex":"0x11", "dec":17},
"FREQ0" : { "hex":"0xC4", "dec":196},
"MDMCFG4" : { "hex":"0x2D", "dec":45}, "MDMCFG4" : { "hex":"0x2D", "dec":45},
"MDMCFG3" : { "hex":"0x3B", "dec":59}, "MDMCFG3" : { "hex":"0x3B", "dec":59},
"MDMCFG2" : { "hex":"0x70", "dec":112}, "MDMCFG2" : { "hex":"0x73", "dec":115},
"DEVIATN" : { "hex":"0x00", "dec":0}, "DEVIATN" : { "hex":"0x00", "dec":0},
"MCSM0" : { "hex":"0x18", "dec":24}, "MCSM0" : { "hex":"0x18", "dec":24},
"FOCCFG" : { "hex":"0x1D", "dec":29}, "FOCCFG" : { "hex":"0x1D", "dec":29},

View File

@ -1,6 +1,6 @@
Handheld Init Handheld Init
2.4312 GHZ (mid) 2.4312 GHZ (mid)
2.439 (strong) 2.439256 (strong)
2.447 GHZ (strong) 2.447 GHZ (strong)
2.4632 GHZ (strong) 2.4632 GHZ (strong)
2.471 GHZ (weak) 2.471 GHZ (weak)

BIN
images/signals/signal00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

27
read.py
View File

@ -35,6 +35,13 @@ def burst_read(addr, length):
READ_BURST = ACCESS["READ_BURST"]["dec"] READ_BURST = ACCESS["READ_BURST"]["dec"]
return spi.xfer2([addr | READ_SINGLE | READ_BURST] + [0x00] * length) return spi.xfer2([addr | READ_SINGLE | READ_BURST] + [0x00] * length)
def read_fifo():
# Burst read RX FIFO
READ_BURST = ACCESS["READ_BURST"]["dec"]
RXFIFO = MEMORY["RXFIFI"]["dec"]
fifo = spi.xfer2([RXFIFO | READ_BURST] + [0x00]*64) # Max 64 bytes
return fifo[1:]
def read_register(addr): def read_register(addr):
READ_SINGLE = ACCESS["READ_SINGLE"]["dec"] READ_SINGLE = ACCESS["READ_SINGLE"]["dec"]
@ -65,7 +72,7 @@ def receive_packet():
strobe(SRX) # SRX strobe(SRX) # SRX
# Wait for data (use GDO0 in real app) # Wait for data (use GDO0 in real app)
time.sleep(0.1) time.sleep(0.5)
# Check RXBYTES # Check RXBYTES
RXBYTES = STATUS["RXBYTES"]["dec"] RXBYTES = STATUS["RXBYTES"]["dec"]
@ -76,7 +83,7 @@ def receive_packet():
# Read data # Read data
RXFIFO = MEMORY["RXFIFO"]["dec"] RXFIFO = MEMORY["RXFIFO"]["dec"]
data = burst_read(RXFIFO, rx_bytes) # 0x3F = RX FIFO data = read_fifo() # 0x3F = RX FIFO
print(f"Received: {data}") print(f"Received: {data}")
return data return data
@ -93,6 +100,16 @@ def test_read_write_reg():
print("check ",check) print("check ",check)
return check == test_value return check == test_value
def disable_crc():
spi.xfer2([CONFIG_REGS["PKTCTRL0"]["dec"], 0x01])
def dump_reg():
for reg_name_group, regs in regs_data.items():
for reg_name, reg_loc in regs.items():
addr = reg_loc['dec']
reg_value = read_register(addr)
print(reg_name + ":"+str(reg_value))
if __name__ == "__main__": if __name__ == "__main__":
spi = spidev.SpiDev() spi = spidev.SpiDev()
spi.open(0, 0) # Bus 0, CE0 (Pin 24) spi.open(0, 0) # Bus 0, CE0 (Pin 24)
@ -124,9 +141,10 @@ if __name__ == "__main__":
print(f"Status byte: 0x{status:02X}") print(f"Status byte: 0x{status:02X}")
print("Reading VERSION register...") print("Reading VERSION register...")
version = read_register(0x31) version = read_register(VERSION)
print(f"CC2500 VERSION register: 0x{version:02X}") print(f"CC2500 VERSION register: 0x{version:02X}")
# dump_reg()
for reg_name, values in init_data.items(): for reg_name, values in init_data.items():
addr_dec = regs_data["CONFIG_REGS"][reg_name]["dec"] addr_dec = regs_data["CONFIG_REGS"][reg_name]["dec"]
@ -137,6 +155,9 @@ if __name__ == "__main__":
# print(values["hex"]) # print(values["hex"])
# print("writing "+str(addr_hex) + " to "+str(addr_dec)) # print("writing "+str(addr_hex) + " to "+str(addr_dec))
write_reg(addr_dec, value_dec) write_reg(addr_dec, value_dec)
disable_crc()
time.sleep(2)
# dump_reg()
print("Read + Write test ", test_read_write_reg()) print("Read + Write test ", test_read_write_reg())
try: try:
while True: while True: