geolink / opentracker

OpenTracker - open source GPS/GLONASS hardware
GNU General Public License v2.0
163 stars 68 forks source link

Documentation of pinouts is unclear #44

Closed leekillough closed 8 years ago

leekillough commented 8 years ago
  1. I am confused on Page 21 of the manual, where it implies there are extra "Analog, PWM, GPIO" pins on the expansion header. Are they the ones labeled EXT_PA21, EXT_PA22, EXT_PA23? Can they each be programmed as either Analog IN, Digital IN, Digital OUT, Open Collector, or PWM, or are they limited to digital in/out?
  2. What Is EXT_NS0? Is it a digital output which can be used to select a SPI slave device, as well as a possibly independent digital output if you don't need to select between multiple SPI devices?
  3. How many, if any, of the CAN, I2C, SPI, and serial (RX/TX + RX2/TX2) pins can be reprogrammed for other functions, and to what degree (analog, digital IN/OUT/OC, PWM)?
  4. Is EXT_SCK the SPI sclock, and is EXT_SCL the I2C sclock? I wanted to make sure, since I2C and SPI were not mentioned in detail in the manual. Perhaps sections on I2C and SPI, with simple circuit examples, should be added.
ppescher commented 8 years ago

The design of OpenTracker 2 is derived from Arduino Due and tries to be as much software compatible as possible. Some pins are configured the same way, some are different. Please have a look at: https://github.com/geolink/opentracker-arduino-board/blob/master/1.0.2/variants/geolink_opentracker/variant.h and CPP file, where you can see what function is the default one for each pin.

To answer your questions:

  1. Usually all the pins can function as digital I/O, some have PWM capability, some can be analog inputs. See OpenTracker "variant.h/.cpp"
  2. NS0 is standard naming for Atmel SAM3 MCU. It is a "slave select" or "chip select" pin for the SPI.
  3. Again, please look at "variant.h/.cpp" and refer to the SAM3AC4 datasheet for multiplexed pin functions. The only analog pins in the expansion header are PA22/PA23 (you can use AIN_pin_name definitions for analog functions) and PA21 can be a PWM output.
  4. SCK is the SPI serial clock. SCL is the I2C serial clock. This is common naming, but thanks for your comments. We'll try to improve the manual.