Source code running on Mictronics hardware Turtle-Rover hat.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.atmelstart Initial commit. Atmel START generated source code. Jan 16, 2018
CMSIS/Include Add Cortex controller environment to build on Linux. Jan 27, 2018
Config Start motors with PWM offset since they will not run below 50% duty c… Nov 18, 2018
Debug Rewrite openocd script to select correct interface configuration. Nov 15, 2018
Device_Startup Git marked modified but in fact not changed. Aug 6, 2018
Hardware Update hardware revision I. Nov 16, 2018
examples Add files and folders required for build process on Raspberry Pi. Oct 27, 2018
hal Manipulator math working. Fixes #1. Dec 14, 2018
hpl Check and add missing license to files. Jan 25, 2018
hri Initial commit. Atmel START generated source code. Jan 16, 2018
samd20 Add Cortex controller environment to build on Linux. Jan 27, 2018
.gitignore Add files and folders required for build process on Raspberry Pi. Oct 27, 2018
LICENSE Notice for different ASF license. Jan 24, 2018
README.md Link formating fixed. Dec 13, 2018
Turtle-Rover Hat.atsln Project renamed due to naming requirements in Atmel Studio when using… Jan 27, 2018
driver_init.c Removed obsolete code on hardware rev. I. Oct 27, 2018
driver_init.h Removed obsolete code on hardware rev. I. Oct 27, 2018
main.c Manipulator math done in electronics hat now. Dec 13, 2018
main.h Set correct order of ADC channel sampling to fit with motor position. Feb 11, 2018
turtlerover.componentinfo.xml Project renamed due to naming requirements in Atmel Studio when using… Jan 27, 2018
turtlerover.cproj Project renamed due to naming requirements in Atmel Studio when using… Jan 27, 2018

README.md

Turtle Rover electronics hat - Mictronics version

An alternative hardware of the Raspberry Pi hat that serves as an external interface and motor controller for the Turtle Rover.

http://turtlerover.com/

https://www.facebook.com/TurtleRover/

https://github.com/TurtleRover/

https://www.mictronics.de/

https://github.com/mictronics/

Features

  • Dual RECOM switch mode power supply, up to 3A for Raspberry Pi and 4A servo supply.
  • Maximum 24V supply voltage, up to 6S LiPo battery.
  • Battery voltage monitor.
  • Power button or switch input with software power off.
  • Software power off either via ARM controller GPIO or via Raspberry Pi GPIO.
  • Supports 4 DC motors up to 2A each.
  • Current sensing for each motor.
  • External I2C bus, 5V tolerant (accessible by Raspberry Pi).
  • External serial RS232 interface (accessible by Raspberry Pi).
  • External input for PPM sum signal from standard RC receiver, up to 12 channels, 5V tolerant.
  • Supports three high voltage RC servos.
  • Supports three open drain outputs, 30V/1A each.
  • Atmel SAMD20J18 32-bit Cortex-M0 ARM controller with 256KB flash and 32KB of SRAM.
  • 32kbit on-board I2C EEPROM (accessible by Raspberry Pi).
  • System halt signal to support Raspberry Pi in read-only mode. Jumper socket to enable write mode. See Adafruit article.
  • Serial and I2C interface to Raspberry Pi server.
  • Remote debugging through Raspberry Pi. See Turtle-Rover blog.
  • Works stand-alone (without Raspberry Pi) when controlled by external RC receiver through PPM sum signal.
  • Source code allows full interrupt driven, non-blocking operation.

Software power off

The software power off features will cut Turtle Rover power either by a server command that controls the ARM GPIO pin or, when selected, automatically on Raspberry Pi shutdown. In both cases the power button needs to be pressed 4-5 seconds to turn on Turtle Rover power and keep it running. This avoids any accidentally power on with short button press.

Either mode will be selected by the solder jumper J1 on the hardware rev.I board:

1-2 Electronics hat (ARM) commanded power off
2-3 Raspberry Pi auto shutdown power off

Using the automatic Raspberry Pi shutdown requires additional configuration of GPIO usage. Edit /boot/config.txt and add the line dtoverlay=gpio-poweroff,gpiopin=19,export=y,active_low=y.

Build

Building on Windows environment

This source code was developed using Atmel Studio 7. Builds also under Netbeans when Atmel Studio is installed. Requires GNU embedded toolchain for Arm (arm-none-eabi-gcc) to build. Use of Atmel Studio 7 or higher recommended.

Building directly on Turtle Rovers Raspberry Pi or Linux environment

  1. Install ARMinARM, follow instructions.
  2. Mandatory: Execute step 1) in ARMinARM setup to install the toolchain.
  3. Optional: Execute step g) in ARMinARM setup to install OpenOCD for direct programming the SAMD20J18.
  4. git clone https://github.com/Mictronics/turtle-rover-hat
  5. cd turtle-rover-hat/Debug
  6. make -j4 -f StaticMakefile all
  7. To program the SAMD20J18 run sudo openocd -f openocd.cfg

Atmel START Note

Source code is based on Atmel START skeleton including the following drivers:

  • System control driver.
  • Generic clock driver.
  • Power management driver.
  • ADC asynchronous driver.
  • I2C asynchronous slave driver (modified and extened to support Linux i2cdetect, master read/write via i2cget&i2cset).
  • I2C asynchronous master driver.
  • USART asynchronous driver.
  • Asynchronous timer driver in PWM mode.
  • Asynchronous timer driver in capture mode (modified and extented to support event capture interrupts).
  • Watchdog driver.
  • Delay driver.
  • Event system driver
  • External interrupt driver
  • RTC driver as simply periodic counter (Ported from Atmel ASF).

For details see Atmel START

In my humble opinion, from experience with Atmel START in this project, you should not consider Atmel START generated source code ready for production unless you are willing to spend a hugh amount of time and efforts in debugging. Having an ICE hardware is a must.

Hardware

Schematic and layout were designed using Target3001. The PCB is available in native Target3001 format and can be opened either by any full version of this software or with Target3001 Viewer. Many board manufactures will handle the Target3001 format directly. The Eagle board is an export out of Target3001 and might not work as expected. (Schematic export doesn't open in Eagle, so not available). As a third option a Gerber export is available (check carefully before making boards from it).