Skip to content

Commit

Permalink
ASR6601 SiP: built-in Semtech SX1262 radio receive and transmit funct…
Browse files Browse the repository at this point in the history
…ions are doing Ok [skip ci]
  • Loading branch information
lyusupov committed Feb 10, 2022
1 parent 5a30530 commit b8ddee1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Model(s)|Platform|First appearance|       Sta
[**Badge**](https://github.com/lyusupov/SoftRF/wiki/Badge-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Nordic Semiconductor<br>nRF52840](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52840)|Q4 2020|![](https://via.placeholder.com/140x70/00A000/000000?text=Good)|&nbsp;
ES|[NXP Semiconductors<br>LPC4320](https://en.wikipedia.org/wiki/NXP_LPC#LPC4000_series)|Q2 2021|![](https://via.placeholder.com/140x70/FFFF00/000000?text=In+progress)|Unique RF radio specs are useful for 1090ES **ADS-B** reception [ [1](https://user-images.githubusercontent.com/5849637/140610617-7c74582e-b0d7-4610-8ac2-d51f55c9086d.png) , [2](https://raw.githubusercontent.com/lyusupov/SoftRF/master/documents/images/ES-1.jpg) ]
[Academy](https://github.com/lyusupov/SoftRF/wiki/Academy-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Microchip&nbsp;(Atmel)<br>SAM&nbsp;D21](https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/32-bit-mcus/sam-32-bit-mcus/sam-d) and [ATmega2560](https://www.microchip.com/en-us/product/ATmega2560)|Q4 2021|![](https://via.placeholder.com/140x40/c5f015/000000?text=May+need)<br>![](https://via.placeholder.com/140x40/c5f015/000000?text=improvements)<!-- ![](https://via.placeholder.com/140x70/FFFF00/000000?text=In+progress) -->|good for teaching students of air traffic proximity awareness
|[ASR Microelectronics<br>ASR6601](https://asriot.readthedocs.io/en/latest/index.html)|Q1 2022|![](https://via.placeholder.com/140x70/FFFF00/000000?text=In+progress)| [ [1](https://user-images.githubusercontent.com/5849637/152556525-8e50c1af-9ea0-4d8a-a866-4864bb2a5186.png) ]

## By sub-1 GHz radio
Radio|Model(s)|First appearance|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|Notes
Expand Down
3 changes: 0 additions & 3 deletions software/firmware/source/SoftRF/src/driver/RF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,7 @@ static bool sx1276_probe()

#define CMD_READREGISTER 0x1D
#define REG_LORASYNCWORDLSB 0x0741

#if !defined(SX126X_DEF_LORASYNCWORDLSB)
#define SX126X_DEF_LORASYNCWORDLSB 0x24
#endif

static void sx1262_ReadRegs (uint16_t addr, uint8_t* data, uint8_t len) {
hal_spi_select(1);
Expand Down
3 changes: 3 additions & 0 deletions software/firmware/source/SoftRF/src/platform/ASR66.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ static void ASR66_User_Key_Wakeup()

static void ASR66_setup()
{
NVIC_DisableIRQ(LORA_IRQn);

pinMode(SOC_GPIO_PIN_ANT_VDD, OUTPUT);
digitalWrite(SOC_GPIO_PIN_ANT_VDD, HIGH);
}

static void ASR66_post_init()
Expand Down
7 changes: 3 additions & 4 deletions software/firmware/source/SoftRF/src/platform/ASR66.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
#define SERIAL_FLUSH() ({ while (Serial .availableForWrite() < 1024); })
#define GNSS_FLUSH() ({ while (Serial_GNSS_Out.availableForWrite() < 1024); })

#define SX126X_DEF_LORASYNCWORDLSB 0xB2

enum rst_reason {
REASON_DEFAULT_RST = 0, /* normal startup by power on */
REASON_WDT_RST = 1, /* hardware watch dog reset */
Expand Down Expand Up @@ -88,7 +86,7 @@ struct rst_info {
#define SOC_GPIO_PIN_GNSS_RX 4
#define SOC_GPIO_PIN_UART1_TX 5 /* NC */

#define SOC_GPIO_PIN_UART3_RX 45 /* NC */
#define SOC_GPIO_PIN_UART3_RX 29 /* NC */
#define SOC_GPIO_PIN_GNSS_TX 44

#define SOC_GPIO_PIN_LED SOC_UNUSED_PIN
Expand Down Expand Up @@ -116,7 +114,8 @@ struct rst_info {
#define SOC_GPIO_PIN_DIO1 LMIC_UNUSED_PIN

/* RF antenna switch */
#define SOC_GPIO_PIN_ANT_RXTX LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_ANT_RXTX 59
#define SOC_GPIO_PIN_ANT_VDD 45

/* I2C */
#define SOC_GPIO_PIN_SDA 15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ bool hal_pin_rst (u1_t val) {
}
#else
bool hal_pin_rst (u1_t val) {
if (val == 0)
LORAC->CR1 |= 1<<5; //nreset
else
LORAC->CR1 &= ~(1<<7); //por
if (val) SX126xReset();

return true;
}
Expand Down Expand Up @@ -283,18 +280,9 @@ void hal_pin_busy_wait (void) {
}
#else
void hal_pin_busy_wait (void) {
delayMicroseconds(10);
int n = 0;
while( LORAC->SR & 0x100 )
{
delayMicroseconds(1);
n++;
if(n>=10000)
{
// printf("spi busy\r\n");
break;
}
}
unsigned long start = micros();

while(((micros() - start) < MAX_BUSY_TIME) && (LORAC->SR & 0x100)) /* wait */;
}
#endif /* ARDUINO_ARCH_ASR6601 */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ enum _dr_eu868_t { DR_SF12=0, DR_SF11, DR_SF10, DR_SF9, DR_SF8, DR_SF7, DR_SF7B,
#if defined(ESP32) || defined(ESP8266) || defined(__ASR6501__) || \
defined(ARDUINO_ARCH_ASR650X) || defined(ARDUINO_ARCH_ASR6601)
#include <pgmspace.h>
#if defined(ARDUINO_ARCH_ASR6601)
#include "tremo_regs.h"
#endif /* ARDUINO_ARCH_ASR6601 */
#elif defined(ARDUINO_ARCH_NRF52)
#include <avr/pgmspace.h>
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ static void SetDIO3AsTcxoCtrl (uint8_t voltage) {
uint32_t timeout = 320;
uint8_t data[] = {voltage, (timeout >> 16) & 0xff, (timeout >> 8) & 0xff, timeout & 0xff };

writecmd(CMD_SETDIO3ASTCXOCTRL, data, sizeof(data));
#if defined(ARDUINO_ARCH_ASR6601)
if (LORAC->CR1 & 0x1)
#endif /* ARDUINO_ARCH_ASR6601 */
writecmd(CMD_SETDIO3ASTCXOCTRL, data, sizeof(data));
}

// write payload to fifo buffer at offset 0
Expand Down

0 comments on commit b8ddee1

Please sign in to comment.