User Tools

Site Tools


digix:tutorials:basics

(Improvements, tips, more basics, etc are welcome here!)

What follows is a list of tips and differences for using the DigiX vs using the Arduino Due - for most users we've set everything up (if you're using our modified IDE) so it will work how you expect - but if you have questions about pin assignments, serial ports, etc - here are some answers.

Otherwise - Here is a great getting started guide that applies to the DigiX just as well: http://arduino.cc/en/Guide/ArduinoDue

Buttons:

The DigiX comes with two hardware buttons:

RESET speaks for itself, and is equivalent to the RESET button found on other Arduino boards. Note that this button will NOT reset the Wifi module. It this is what you need, it can be achieved in a few different ways, please refer to this page.

ERASE does a full erase of the MCU's program space flash memory - leaving only the read-only USB bootloader - which makes the port show up as a Bossa Programming Port - but it can be programmed from the IDE just the same.

The reason for it is that the regular DigiX bootloader runs in program space, so if your program crashes (overrun, 100% cpu, etc) it won't be able to be reprogrammed - you can then hit erase (and then reset) to go back to the read only bootloader, program, and be back in the game.

Tips:

If the COM port isn't showing in the Arduino IDE - unplug and replug the board. If that doesn't work - while plugged in, hold down the erase button on the board for a moment and then unplug and replug - you may then have to select it from the com port menu as it may be on a different port - but it is a sure way to get it to respond even if your sketch crashed the USB stack.

Since the DigiX has only one USB port and it uses a CDC serial stack the DigiX does not reset when the port is opened, using the code below in setup() can pause the sketch until you connect and send a character from the serial monitor:

  Serial.begin(9600); 

  //DigiX trick - since we are on serial over USB wait for character to be entered in serial terminal before continuing 
  while(!Serial.available()){
    Serial.println("Enter any key to begin");
    delay(1000);
  }

Watchdog/WDT vs Standard DigiX in board menu

The watchdog version is setup to allow the watchdog timer to work. If you don't want to use a watchdog timer or don't know what one is then use the standard version, otherwise your board will keep restarting.

If you want to use the watchdog timer here is a great example and post about it: http://digistump.com/board/index.php/topic,1356.msg6174.html#msg6174

Differences when using the modified Arduino IDE:

If you have installed the DigiX additions to the Arduino IDE (either in the form of the Digistump version of the IDE or the add-on files) and you use the “DigiX” board option to program your DigiX then you should be aware of the following differences:

  1. The computer connected USB port is accessible by SerialUSB AND Serial (ex. SerialUSB.begin(9600) AND Serial.begin(9600) are the same thing) The Serial port on pins 0 and 1 has been renamed Serial0 and is usable even when Serial to computer communications are being used.
  2. Pin numbers on the board are the pin numbers for the IDE.
  3. Flip over your board for alternative functions for the pins. All pins are usable though 110-113 have 10k pull ups (and can be used for JTAG) on them and 104,105 are connected to the WiFi module for (optional) hardware flow control. Those pins can be disconnected from the WiFi module using the solder jumpers on the bottom (by cutting the trace between the jumpers).
  4. Pin 106 can be tied to WiFi reset if desired by the solder jumper on the back.
  5. Pins 52 (CSN) and 53 (CE) are shared with the nRF24L01+ module - remove the module to use them for other things.
  6. Pin 51 can be tied to the nRF module's IRQ line by the solder jumper on the back.
  7. Serial1 is shared with the wifi module - remove the WiFi enable jumper to disable it.
  8. The Micro SD card is on the default slave select pin so the SD library works out of the box.
  9. Examples are provided for the DigiFi (DigiX WiFi), EEPROM, and nRF module - the WiFi library is for the Arduino WiFi shield and is not compatible with the DigiX module.

Differences when using the unmodified Arduino IDE:

If you have not installed the DigiX additions to the Arduino IDE (either in the form of the Digistump version of the IDE or the add-on files) and you use the “Arduino Due (Native Port)” option to program your DigiX then the following differences need to be taken into account:

  1. The computer connected USB port is accessible by SerialUSB not Serial (ex. SerialUSB.begin(9600) not Serial.begin(9600) - often sketches assume Serial is the one connected to the computer and because of this you'll need to change those calls to SerialUSB for them to work with the Serial Monitor/other applications. If you are programming using our addon file/version of the IDE and the DigiX entry in the boards list then you do no need to do this.
  2. Serial1 is shared with the wifi module - remove the WiFi enable jumper to disable it.
  3. The Micro SD card is on the default slave select pin so the SD library works out of the box.
  4. The “Arduino Due (Programming Port)” option does not work, as the DigiX only has one USB interface.
  5. Pins 90-113 are not usable.

Additional Documents

digix/tutorials/basics.txt · Last modified: 2014/03/14 22:57 by digistump