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.
- 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.
/boot/config.txt and add the line
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
- Install ARMinARM, follow instructions.
- Mandatory: Execute step 1) in ARMinARM setup to install the toolchain.
- Optional: Execute step g) in ARMinARM setup to install OpenOCD for direct programming the SAMD20J18.
git clone https://github.com/Mictronics/turtle-rover-hat
make -j4 -f StaticMakefile all
- 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.
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).