summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-11-18 03:48:08 +0000
committerChristian Pointner <equinox@mur.at>2012-11-18 03:48:08 +0000
commit105c1dba6b13bd732c49be7e1c38c7f9cde823e7 (patch)
tree604f6aa71a1fd18526e7976817e79a648fc53b74
parentworkaround tx buffer underflow (diff)
hhd70dongle with new hardware
git-svn-id: https://svn.spreadspace.org/mur.sat@647 7de4ea59-55d0-425e-a1af-a3118ea81d4c
-rw-r--r--software/hhd70dongle/c1101lib.c9
-rw-r--r--software/hhd70dongle/hhd70.c14
-rw-r--r--software/hhd70dongle/hhd70.h2
-rw-r--r--software/hhd70dongle/hhd70dongle.c9
4 files changed, 20 insertions, 14 deletions
diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c
index 2f0400e..ddbd28c 100644
--- a/software/hhd70dongle/c1101lib.c
+++ b/software/hhd70dongle/c1101lib.c
@@ -354,7 +354,7 @@ void c1101_init_ook_beacon(void)
// Data format = Synchronous serial mode
// Data rate = 1.00112
// RX filter BW = 58.035714
- // PA ramping = true
+ // PA ramping = false
// Preamble count = 2
// Address config = No address check
// Whitening = false
@@ -368,7 +368,7 @@ void c1101_init_ook_beacon(void)
// Base frequency = 435.199677
// Channel number = 0
// PA table
- char const pa_table[8] = {0x00,0x12,0x0e,0x34,0x60,0xc5,0xc1,0xc0};
+ char const pa_table[8] = {0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00};
//reset C1101
c1101_spi_strobe_command(SPIC1101_ADDR_SRES);
@@ -384,10 +384,13 @@ void c1101_init_ook_beacon(void)
//enable RX FIFO interrupt (i.e. GPO2 pulls high if >= FIFOTHR bytes are in RX FIFO)
c1101_spi_write_register(SPIC1101_ADDR_IOCFG2, 0x41 ); //0x40, 0x42, 0x44, 0x47
// pull GPO high (interrupt) if more than 12 bytes in rx buffer (or less than 53 in tx)
+
//c1101_spi_write_register(SPIC1101_ADDR_FIFOTHR,0x47); //RX FIFO and TX FIFO Thresholds
c1101_spi_write_register(SPIC1101_ADDR_FIFOTHR, 0); //assert at 4 bytes in RX Fifo and 61 in TX Fifo
+
//c1101_spi_write_register(SPIC1101_ADDR_PKTCTRL0,0x12);//Packet Automation Control
c1101_spi_write_register(SPIC1101_ADDR_PKTCTRL0, 0b0000000001); //crc disabled; use FIFOs; variable packet length mode (first TX FIFO byte must be length)
+
c1101_spi_write_register(SPIC1101_ADDR_FSCTRL1,0x06); //Frequency Synthesizer Control
c1101_spi_write_register(SPIC1101_ADDR_FREQ2,0x10); //Frequency Control Word, High Byte
c1101_spi_write_register(SPIC1101_ADDR_FREQ1,0xBD); //Frequency Control Word, Middle Byte
@@ -400,7 +403,7 @@ void c1101_init_ook_beacon(void)
c1101_spi_write_register(SPIC1101_ADDR_MCSM0,0x18); //Main Radio Control State Machine Configuration
c1101_spi_write_register(SPIC1101_ADDR_FOCCFG,0x16); //Frequency Offset Compensation Configuration
c1101_spi_write_register(SPIC1101_ADDR_WORCTRL,0xFB); //Wake On Radio Control
- c1101_spi_write_register(SPIC1101_ADDR_FREND0,0x17); //Front End TX Configuration
+ c1101_spi_write_register(SPIC1101_ADDR_FREND0,0x11); //Front End TX Configuration
c1101_spi_write_register(SPIC1101_ADDR_FSCAL3,0xE9); //Frequency Synthesizer Calibration
c1101_spi_write_register(SPIC1101_ADDR_FSCAL2,0x2A); //Frequency Synthesizer Calibration
c1101_spi_write_register(SPIC1101_ADDR_FSCAL1,0x00); //Frequency Synthesizer Calibration
diff --git a/software/hhd70dongle/hhd70.c b/software/hhd70dongle/hhd70.c
index 9b79797..0abe61d 100644
--- a/software/hhd70dongle/hhd70.c
+++ b/software/hhd70dongle/hhd70.c
@@ -36,8 +36,8 @@
void hhd70_init(void)
{
//configure Direction of SS / PB0 , MOSI and SCLK as Output to drive CS of CC1101
- SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS)|(1<<RE)|(1<<TE);
- SPI_PORT = (1<<CS) | (1<<RE) | (1<<TE) | (1<<GDO2);
+ SPI_DDR = (1<<MOSI)|(1<<SCK)|(1<<CS)|(1<<TE)|(1<<BIAS_PWM);
+ SPI_PORT = (1<<CS) | (1<<GDO2) | (1<<BIAS_PWM);
SPCR = (1<<SPE)|(1<<MSTR); // | (0<<DORD) //select MSB first: DORD == 0
// SPSR = (0<<SPI2X) // f_osc/4
// SPSR = (1<<SPI2X) // f_osc/2
@@ -90,23 +90,21 @@ char hhd70_spi_read_byte(void)
void hhd70_palna_txmode(void)
{
- SPI_PORT |= (1<<RE);
- SPI_PORT &= ~(1<<TE);
+ SPI_PORT |= (1<<TE);
}
void hhd70_palna_rxmode(void)
{
- SPI_PORT |= (1<<TE);
- SPI_PORT &= ~(1<<RE);
+ SPI_PORT &= ~(1<<TE);
}
void hhd70_palna_off(void)
{
- SPI_PORT |= (1<<RE) | (1<<TE);
+ SPI_PORT |= (1<<TE);
}
int8_t hhd70_rx_data_available(void)
{
//check if GDO2 pin has been pulled low by c1101
return (SPI_PINB_REG & (1 << GDO2)) == 0;
-} \ No newline at end of file
+}
diff --git a/software/hhd70dongle/hhd70.h b/software/hhd70dongle/hhd70.h
index 4adeb3e..c5b001f 100644
--- a/software/hhd70dongle/hhd70.h
+++ b/software/hhd70dongle/hhd70.h
@@ -46,7 +46,7 @@
//GDO0 currently only used for c1101 internal temperature sensor
//GDO0 future use: connect directly to RX/TX Switch (set GDO0_CFG to 0x2F)
#define GDO0 DDB5
-#define RE DDB6
+#define BIAS_PWM DDB6
#define TE DDB7
diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c
index ed6ee3c..b328d55 100644
--- a/software/hhd70dongle/hhd70dongle.c
+++ b/software/hhd70dongle/hhd70dongle.c
@@ -168,6 +168,11 @@ int main(void)
int8_t fdev_m = 1;
int8_t fdev_e = 1;
+ char mursat_beacon[256];
+ for(int i=0;i<sizeof(mursat_beacon);++i) {
+ mursat_beacon[i] = 0xFF;
+ }
+
for(;;)
{
int16_t num_bytes_received = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);
@@ -330,10 +335,10 @@ int main(void)
if (enable_beacon_part)
{
- char mursat_beacon[8] = {0b11101110, 0b11100010, 0b00111010, 0b10101000, 0b10001110, 0b11101110, 0b00101011, 0b10100000}; //OE6EOF
+// char mursat_beacon[8] = {0b11101110, 0b11100010, 0b00111010, 0b10101000, 0b10001110, 0b11101110, 0b00101011, 0b10100000}; //OE6EOF
led_on();
CDC_Device_SendString(&VirtualSerial_CDC_Interface,"OOK Sending Beacon\r\n");
- c1101_transmitData_infPktMode(mursat_beacon,8);
+ c1101_transmitData_infPktMode(mursat_beacon,sizeof(mursat_beacon));
led_off();
}
}