Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - modtro2

Pages: [1] 2 3 ... 38
1
Wireless Modules / Re: inAir9b Sleep Current
« on: August 21, 2016, 06:06:31 PM »
Hi, the inAir4, inAir9 and inAir9B boards consist of just the SX1276 or SX1278 chip and the voltage switch (vswitch). Only these two items will consume power. And, when the voltage switch is disabled, it is only the SX1276/8 chip that consumes power. Our inAir4, inAir9 and inAir9B modules consume exactly the currents given in the SX1276/8 datasheet. You must be doing something wrong if you are getting 300uA. Do you have all inputs of the SX1276/8 chip connected to 0 or 3.3V? Leaving an input floating can cause it to oscillate, consuming a lot of power. Also note the the SX1276/8 chip is very complex, and you have to ensure your software is configuring it for the correct low power mode.

2
Wireless Modules / Re: inair9b J4 question
« on: March 13, 2016, 04:47:04 PM »
Hello, all inAir boards(inAir4, inAir9 and inAir9B) are maximum 3.6V. Do not connect 5V supply to them. You can also refer to the SX1276 and SX1278 datasheets.

Please refer to the schematic and pinout diagram on product page.




3
Following code can be used to write to LCD2S display, and read keys via Arduino.

Code: [Select]
#include <Wire.h>


// LCD2S Commands /////////////////////////////////////////////////////////////
#define CMD_WRITE_STRING    0x80    // Write parsed String command
#define CMD_CONFIG_DEVICE   0x95    // Configure device using 4 bytes
#define CMD_GET_STATUS      0xD0    // Read Status command
#define CMD_GET_KEY         0xD1    // Get Key command

// Constant Variables /////////////////////////////////////////////////////////
const int ledPin =  13;                     //The number of the LED pin
const unsigned char LCD2S_I2C_ADR = 0x28;   //I2C address of the LCD

// Variables //////////////////////////////////////////////////////////////////
int ledState = LOW;             // ledState used to set the LED

unsigned long tmrFlashLed = 0;  // Timer for flashing system LED
unsigned long tmrCheckKey = 0;  // Check if a key on keyboard was pressee

void setup()
{
  Wire.begin();         //Join bus as master
  Serial.begin(9600);   // start serial for output

  // set the digital pin as output:
  pinMode(ledPin, OUTPUT);

  //Initialize LCD2S
  delay(300);           //Give LCD2S time to initialize itself
  initializeLcd2s();

  //Write "Hello World" message
  Wire.beginTransmission(LCD2S_I2C_ADR);  //Start condition at the given I2C address or Mark the beginning of a data packet, change 0x28 to your device's I2C address
  Wire.write(CMD_WRITE_STRING);           //Display Commands
  Wire.write(0x0c);                       //Clear display and go to first line
  Wire.write("Hello world!");             //Write message
  Wire.endTransmission(false);            //End condition or Mark the end of data packet and send to LCD and hold bus connection
}

void loop() {

  unsigned long currentMillis = millis();

  // Check if key was pressed every 50ms ///////////////////
  if(currentMillis - tmrCheckKey >= 50) {
    unsigned char status, key;
    tmrCheckKey = currentMillis;

    //Read "status" register of LCD2S. Bit 7(MSB) indicates if Keypad buffer contains any data
    Wire.beginTransmission(LCD2S_I2C_ADR);
    Wire.write(CMD_GET_STATUS);             //"Get Status Register" command
    Wire.endTransmission(false);            //Send "repeated start"
    Wire.requestFrom(LCD2S_I2C_ADR, 1);     //Request 1 bytes from slave device = Status byte
    while (Wire.available()) {
      status = Wire.read();                 //Receive status byte
    }

    //Has the LCD got keys to be read
    if (status & 0x80) {
      char buf[10];
      Serial.print("\r\nButton Pressed");
     
      //Get key from LCD
      Wire.beginTransmission(LCD2S_I2C_ADR);
      Wire.write(CMD_GET_KEY);                //"Get Key" command
      Wire.endTransmission(false);            //Send "repeated start"
      Wire.requestFrom(LCD2S_I2C_ADR, 1);     //Request 1 bytes from slave device = Status byte
      while (Wire.available()) {
        key = Wire.read();                    //Receive status byte
      }

      //Write key code to second line of LCD
      Wire.beginTransmission(LCD2S_I2C_ADR);  //Start condition at the given I2C address or Mark the beginning of a data packet, change 0x28 to your device's I2C address
      Wire.write(CMD_WRITE_STRING);           //Display Commands
      Wire.write(0x0d);                       //Go to beginning of first line
      Wire.write(0x0a);                       //Go to beginning of next line = second line
      Wire.write("Key = ");                   //Write message
      sprintf((char*)buf, "%c", key);
      Wire.write(buf);                        //Write key code
      Wire.endTransmission(false);            //End condition or Mark the end of data packet and send to LCD and hold bus connection
    }
  }

 
  // Flash system LED ///////////////////////////////////////
  if(currentMillis - tmrFlashLed >= 500) {
    tmrFlashLed = currentMillis;

    //Serial.print("blink");    // print the character
   
    //Toggle LED
    ledState = !ledState;
    digitalWrite(ledPin, ledState);
  }
}


/**
 * Initialization code to initialize I2C 1 and LCD2S display connected to it.
 * Configure LCD using "Configure Device" command (0x95).
 * See LCD2S documentation for details on "Configure Device" command:
 * http://modtronix.com/prod/lcd2s/lcd2sr2_v140.pdf
 */
void initializeLcd2s(void) {
    //Configure LCD
    Wire.beginTransmission(LCD2S_I2C_ADR);  //Start condition at the given I2C address or Mark the beginning of a data packet, change 0x28 to your device's I2C address

    //Byte 1 = 0x95
    //Configure LCD using "Configure Device" command (0x95).
    Wire.write(CMD_CONFIG_DEVICE);          //Configure Device command

    //Byte 2 (Display) of command
    //xx1x xxxx - Interrupt pin is Open Collector output type
    //xxx1 1xxx - Backlight On, Display On
    //xxxx x001 - Cursor off, block cursor off, Cursor moves forward
    //0011 1001 = 0x39
    Wire.write(0x39);

    //Byte 3 (Contrast and Brightness) of command
    //01xx xxxx - Set Backlight to 100 (range is 0 to 255)
    //xx11 0111 - Set contrast to 220 (0x37 x 4)
    //0111 0111 = 0x77
    Wire.write(0x77);
   
    //Byte 4 (keypad and IO) of command
    //0x0f Configures device for 4x4 keypad (if present), OUT1 disabled, GPIO1 to 3 disabled
    Wire.write(0x0f);
   
    //Byte 5 (Keypad and Buzzer) of command
    //01xx xxxx - Keypad Buzzer off
    //xx10 xxxx - Keypad repeat rate = 320ms
    //xxxx 10xx - Keypad Repeat Delay = 1 second
    //xxxx xx10 - Keypad Debounce Time = 64ms
    //0110 1010 = 0x6A
    Wire.write(0x6a);

    //End condition or Mark the end of data packet and send to LCD and hold bus connection
    Wire.endTransmission(false);
}

4
Following code can be used to write to LCD2S, and read key.

Code: [Select]
#include <Wire.h>


// LCD2S Commands /////////////////////////////////////////////////////////////
#define CMD_WRITE_STRING    0x80    // Write parsed String command
#define CMD_CONFIG_DEVICE   0x95    // Configure device using 4 bytes
#define CMD_GET_STATUS      0xD0    // Read Status command
#define CMD_GET_KEY         0xD1    // Get Key command

// Constant Variables /////////////////////////////////////////////////////////
const int ledPin =  13;                     //The number of the LED pin
const unsigned char LCD2S_I2C_ADR = 0x28;   //I2C address of the LCD

// Variables //////////////////////////////////////////////////////////////////
int ledState = LOW;             // ledState used to set the LED

unsigned long tmrFlashLed = 0;  // Timer for flashing system LED
unsigned long tmrCheckKey = 0;  // Check if a key on keyboard was pressee

void setup()
{
  Wire.begin();         //Join bus as master
  Serial.begin(9600);   // start serial for output

  // set the digital pin as output:
  pinMode(ledPin, OUTPUT);

  //Initialize LCD2S
  delay(300);           //Give LCD2S time to initialize itself
  initializeLcd2s();

  //Write "Hello World" message
  Wire.beginTransmission(LCD2S_I2C_ADR);  //Start condition at the given I2C address or Mark the beginning of a data packet, change 0x28 to your device's I2C address
  Wire.write(CMD_WRITE_STRING);           //Display Commands
  Wire.write(0x0c);                       //Clear display and go to first line
  Wire.write("Hello world!");             //Write message
  Wire.endTransmission(false);            //End condition or Mark the end of data packet and send to LCD and hold bus connection
}

void loop() {

  unsigned long currentMillis = millis();

  // Check if key was pressed every 50ms ///////////////////
  if(currentMillis - tmrCheckKey >= 50) {
    unsigned char status, key;
    tmrCheckKey = currentMillis;

    //Read "status" register of LCD2S. Bit 7(MSB) indicates if Keypad buffer contains any data
    Wire.beginTransmission(LCD2S_I2C_ADR);
    Wire.write(CMD_GET_STATUS);             //"Get Status Register" command
    Wire.endTransmission(false);            //Send "repeated start"
    Wire.requestFrom(LCD2S_I2C_ADR, 1);     //Request 1 bytes from slave device = Status byte
    while (Wire.available()) {
      status = Wire.read();                 //Receive status byte
    }

    //Has the LCD got keys to be read
    if (status & 0x80) {
      char buf[10];
      Serial.print("\r\nButton Pressed");
     
      //Get key from LCD
      Wire.beginTransmission(LCD2S_I2C_ADR);
      Wire.write(CMD_GET_KEY);                //"Get Key" command
      Wire.endTransmission(false);            //Send "repeated start"
      Wire.requestFrom(LCD2S_I2C_ADR, 1);     //Request 1 bytes from slave device = Status byte
      while (Wire.available()) {
        key = Wire.read();                    //Receive status byte
      }

      //Write key code to second line of LCD
      Wire.beginTransmission(LCD2S_I2C_ADR);  //Start condition at the given I2C address or Mark the beginning of a data packet, change 0x28 to your device's I2C address
      Wire.write(CMD_WRITE_STRING);           //Display Commands
      Wire.write(0x0d);                       //Go to beginning of first line
      Wire.write(0x0a);                       //Go to beginning of next line = second line
      Wire.write("Key = ");                   //Write message
      sprintf((char*)buf, "%c", key);
      Wire.write(buf);                        //Write key code
      Wire.endTransmission(false);            //End condition or Mark the end of data packet and send to LCD and hold bus connection
    }
  }

 
  // Flash system LED ///////////////////////////////////////
  if(currentMillis - tmrFlashLed >= 500) {
    tmrFlashLed = currentMillis;

    //Serial.print("blink");    // print the character
   
    //Toggle LED
    ledState = !ledState;
    digitalWrite(ledPin, ledState);
  }
}


/**
 * Initialization code to initialize I2C 1 and LCD2S display connected to it.
 * Configure LCD using "Configure Device" command (0x95).
 * See LCD2S documentation for details on "Configure Device" command:
 * http://modtronix.com/prod/lcd2s/lcd2sr2_v140.pdf
 */
void initializeLcd2s(void) {
    //Configure LCD
    Wire.beginTransmission(LCD2S_I2C_ADR);  //Start condition at the given I2C address or Mark the beginning of a data packet, change 0x28 to your device's I2C address

    //Byte 1 = 0x95
    //Configure LCD using "Configure Device" command (0x95).
    Wire.write(CMD_CONFIG_DEVICE);          //Configure Device command

    //Byte 2 (Display) of command
    //xx1x xxxx - Interrupt pin is Open Collector output type
    //xxx1 1xxx - Backlight On, Display On
    //xxxx x001 - Cursor off, block cursor off, Cursor moves forward
    //0011 1001 = 0x39
    Wire.write(0x39);

    //Byte 3 (Contrast and Brightness) of command
    //01xx xxxx - Set Backlight to 100 (range is 0 to 255)
    //xx11 0111 - Set contrast to 220 (0x37 x 4)
    //0111 0111 = 0x77
    Wire.write(0x77);
   
    //Byte 4 (keypad and IO) of command
    //0x0f Configures device for 4x4 keypad (if present), OUT1 disabled, GPIO1 to 3 disabled
    Wire.write(0x0f);
   
    //Byte 5 (Keypad and Buzzer) of command
    //01xx xxxx - Keypad Buzzer off
    //xx10 xxxx - Keypad repeat rate = 320ms
    //xxxx 10xx - Keypad Repeat Delay = 1 second
    //xxxx xx10 - Keypad Debounce Time = 64ms
    //0110 1010 = 0x6A
    Wire.write(0x6a);

    //End condition or Mark the end of data packet and send to LCD and hold bus connection
    Wire.endTransmission(false);
}



5
Wireless Modules / Re: Questions about Devkit-SX12i
« on: March 07, 2016, 03:43:52 PM »
Hi, we have new code for this devkit with many improvements. It allows frequency, Bandwidth and Spreading factor to all be set via user interface. Also other configurations can be done. Can send you current "Beta" version if you want for testing. Will soon upload to GitHub as well.

6
Hi, no the NZ32-SC151 does not include a wireless interface. You can add the inAir4, inAir9 or inAir9B to it if you require a wireless interface.

7
Wireless Modules / Re: Are these boards compatible with the Inair9b?
« on: January 05, 2016, 03:17:16 PM »
Yes, you can use the inAir4, inAir9 and inAir9B boards with any microcontroller board that has an SPI interface and a couple of I/O port. Also ensure the microcontroller board is 3.3V. The link you sent me is a 3.3V board, and will work.

8
Presto Modules and SBC Boards / Re: im1CAN Mode Switch
« on: December 09, 2015, 06:42:50 PM »
Hello Bruce, you said you are using an UNO. Can you please give me details of how you set it for 3.3V operation. The UNO is 5V only. Also, could you share your test program for the Arduino I can use for testing it on Arduino.

9
Presto Modules and SBC Boards / Re: im1CAN Mode Switch
« on: December 08, 2015, 01:49:18 PM »
Hello Bruce, can you maybe post your test program here? I can run it on my side, and see if I can get it to work.

Also please confirm you have set the VIO solder jumper on your board for 3.3V or 5V operation. See the "Configuration" section on Wiki page:
http://wiki.modtronix.com/doku.php?id=products:imod:im1can#configuration

10
Wireless Modules / Re: Using the sx1276 inair4 module with Arduino
« on: December 07, 2015, 02:24:20 AM »
Hi, the UNO is 5V, and can not be directly connected to these 3.3V modules. Are you using level translation chips for connecting the 3.3V I/Os of the inAir4 board to the UNO? If not, it can(will) cause damage to the inAir4 module. The SX1276 chip is very complicated, and there can be many things that can cause it not to work. It is impossible to say what the fault can be. You say it is actually working, but just very low signal power. This could potentially be caused by configuring the chip to use the wrong output. For the inAir4 module, the antenna is connected to the RTI_LF output of the SX1276 chip. Ensure that your code configures this output to be used, and not the RFO_LF or PA_BOOST outputs. Also, ensure the Jumper J4 on the back of the board is made. This enables the antenna switch and logic chip. This jumper should be made by default, but just confirm it is made. See schematic on inAir4 product page for details.

11
Wireless Modules / Re: inAir9, is J1 always here ?
« on: October 12, 2015, 11:08:05 PM »

12
Wireless Modules / Re: Using inAir modules with Raspberry Pi
« on: October 12, 2015, 11:01:18 PM »
Hi, these modules definitely work. I would love to help you get your sample Raspberry Pi project working, it looks great! And I am sure it will help other. I can send you free replacement modules if you think your modules might be faulty(with condition you keep your project open source, and allow me to link to it). Please note following:
  • The software for the SX1276/8 chips are quite complicated. It is very likely it might be a software bug.
  • You mentioned you had pin assignment trouble. You might have damaged your inAir module? Configuring a RPi port as output that is connected to an output pin of the inAir module can damage the inAir module. This will mean you have 2 outputs driving each other.
  • I think you are using the inAir9B modules? They use the PA_BOOST output of the SX1276 chip, and NOT the regular RFO_HF output. This requires different software than that used for the standard SX1276 drivers. If you use the standard drivers that configure the chip to use the RFO_HF output, you will see the condition you are seeing, with a very, very weak output signal. Seeing that the chip will output to the RFO_HF pin that has nothing connected to it!

If you want to make sure, can send you a replacement, and if your module was faulty, you don't have to pay for it. Please note that for

13
Wireless Modules / Using inAir modules with Raspberry Pi
« on: October 08, 2015, 05:19:47 PM »
An interesting project for using the inAir (inAir4, inAir9 or inAir9B) modules with the Raspberry Pi and Python is located here:
https://github.com/mayeranalytics/pySX127x

14
Wireless Modules / Re: inAir9 : DIO0 is not set after a send
« on: October 08, 2015, 03:09:27 PM »
Hi, I have not used this board connected to the Raspberry Pi ports and SPI directly. Sorry, do not have any sample code for that. We have however created a "Virtual Com Port" controlled inAir board, that is connected to a USB port of the RPi. It is basically an inAir Semtech LoRa module connected to a NZ32-SC151 board. The software on the NZ32-SC151 board created a virtual serial port, enabling the LoRa module to be controlled via simple ASCII commands.

Regarding your problem, you say DIO0 is never set. DIO0 can be configured for multiple notifications:
Code: [Select]
RxDone, TxDone or CadDoneI assume you have it configured to be set once transmission is done? If this is the case, and DIO0 is not set, you have to first get that to work. Connect a scope up the the board, and get your code to the stage where DIO0 is set to indicate TxDone. Without this happening, there is something wrong with your code.

15
Wireless Modules / Re: inAir Module Oscillator
« on: October 08, 2015, 02:56:20 PM »
Hi, we state the sensitivity as -139, and not -148. From the product page:
Quote
High sensitivity: down to -139 dBm (-148 only possible with TCXO)
With the current hardware -148 is not possible. It would require a hardware redesign using a TCXO, which we do not have planned.

The baud rate for -148 would be very, very low with not too many applications. It is only about 18 bits per second! For -139dBm is is also very low at 146 bits per second, but still usable. The higher the dBm, the higher the speed. For example, at -120dBm, it is 12500 bits/second, and at -112dBm it is 37500bits/seconds. The dBm is configurable via software.

Regarding the crystal, we use one of the crystals recommended by Semtech. We get these specially manufactured, and had a couple of months lead time just to get the crystals. They are Tolerance=10ppm and G-Senstivity=2ppb/G max.

Pages: [1] 2 3 ... 38