Skip to content

Commit

Permalink
Misc fixes and clean-ups for board avr-rss2
Browse files Browse the repository at this point in the history
  • Loading branch information
herjulf committed Nov 8, 2019
1 parent 0f4b8c1 commit bd26c7a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 108 deletions.
3 changes: 2 additions & 1 deletion boards/avr-rss2/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
USEMODULE += boards_common_atmega

ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += bmx280
USEMODULE += ds18
endif
include $(RIOTCPU)/atmega_common/Makefile.dep
13 changes: 1 addition & 12 deletions boards/avr-rss2/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@

CPU = atmega256rfr2

# This board is based on an atmega CPU, thus import the features from it
include $(RIOTBOARD)/common/arduino-atmega/Makefile.features

# Put defined MCU peripherals here (in alphabetical order)
# Peripherals are defined in common/arduino-atmega/Makefile.features
# Add only additional Peripherals

# Various other features (if any)
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += periph_adc
FEATURES_REQUIRED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

24 changes: 11 additions & 13 deletions boards/avr-rss2/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Document version
V1.3 2019-11-07

# Overview
#Overview
This guide's aim is to help you start using RIOT for RSS2 boards but
platform can support different AtMega-RF boards based on AtMega256RFR2

Expand All @@ -19,30 +19,30 @@ Directory `$(RIOTBASE)/boards/avr-rss2
* Light Sensor.
* 32kHz RTC clock xtal
* HW comparator chip and input.
* Progammable power FET, (relay) for power on/off of sensors.
* Programmable power FET, (relay) for power on/off of sensors.
* Up to 25V DC input via LDO (LP2950). TVS protected.
* Standard. 6-pin TTL-USB header compatibe w. FTDI cable for USART.
* Standard. 6-pin TTL-USB header compatible w. FTDI cable for USART.
* PCB formfactor for cheap project box G.40X IP54
* Power/current use:
* RX ~10mA (Full RPC AtMegaXXRFR2).
* Sleep ~45uA @ 16MHz XTAL
* Sleep ~15uA @ 8MHz using internal oscillator
* Preprogammed Atmel standard bootloader.
* RX ~10mA (Full RPC AtMegaXXRFR2).
* Sleep ~45uA @ 16MHz XTAL
* Sleep ~15uA @ 8MHz using internal oscillator
* Preprogammed Atmel standard stk500v2 bootloader.
* CE certified by test institute.

#USART
The board has one USART via the 6-pin TTL-USB adapter, The default
baudrate is 115200 bps. It's possible to use higher speeds as is 250k
and 500k baud which gives 0% Error with 16MHz clock.
(An addtional USART is on the chip but as default used by interrupt
(An additional USART is on the chip but as default used by interrupt
pins. Needs HW mod to be used)

#RIOT Port Features
The platform has the following key features:
* Standard, E64 address from built-in chip. Chip also has a 128bit ID.

#Toolchain
The Atmel toolcahin is available in most operating systems.
The Atmel toolchain is available in most operating systems.
For a full toolchain and easy installation on Ubuntu:

apt-get install gcc-avr avr-libc avrdude
Expand Down Expand Up @@ -71,7 +71,7 @@ Programming using avrdude using serial bootloader. (TTL-USB cable)
Press the RESET button. The bootloader with wait for boot commands
for 3 seconds.

Flashing hello-wprld line example 256k MCU:
Flashing hello-world line example 256k MCU:
avrdude -p m256rfr2 -c stk500v2 -P /dev/ttyUSB0 -b 115200 -e -U flash:w:bin/rss2-mega256rfr2/hello-world.elf

#Board approvals
Expand All @@ -80,7 +80,7 @@ Rev 2.4
* Safety: IEC 60950-1:2005 2nd Edition +Am 1:2009 +Am 2:2013
* RF: ETSI EN 300 328 V2.1.1 (2016-11)
* EMC: Draft ETSI EN 301 489-1 V2.2.0 (2017-03),
Draft ETSI EN 301 489-17 V3.2.0 (2017-03)
Draft ETSI EN 301 489-17 V3.2.0 (2017-03)
* EMF: EN 62479:2010
* Human exposure to electromagnetic fields: EN 62479:2010

Expand All @@ -102,5 +102,3 @@ http://radio-sensors.com/pictures/s2-2.4-back-port-edited.jpg
#Documentation, schematics, Hardware and Vendor info
http://radio-sensors.com/

# Pinout
include/rss2.h
25 changes: 8 additions & 17 deletions boards/avr-rss2/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define BOARD_H

#include "cpu.h"
#include "rss2.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -38,9 +37,6 @@ extern "C" {
*
* @{
*/
#ifndef STDIO_UART_BAUDRATE
#define STDIO_UART_BAUDRATE (115200) /**< Sets Baudrate for e.g. Shell */
#endif
/** @} */


Expand All @@ -51,8 +47,8 @@ extern "C" {
#define LED_PORT PORTE
#define LED_PORT_DDR DDRE

#define LED0_PIN (1 << LED_RED )
#define LED1_PIN (1 << LED_YELLOW)
#define LED0_PIN (1 << PE4) /* RED */
#define LED1_PIN (1 << PE3) /* YELLOW */

#define LED0_MASK (1 << DDE4)
#define LED1_MASK (1 << DDE3)
Expand All @@ -70,17 +66,17 @@ extern "C" {
* @name Usage of LED to turn on when a kernel panic occurs.
* @{
*/
#define LED_PANIC LED0_ON //LED_RED_ON
#define LED_PANIC LED0_ON
/** @} */


/**
* @name DS18 pins OW_BUS_0
* @{
*/
#define DS18_PARAM_PIN 0xD7
#define DS18_PARAM_PULL (GPIO_IN_PU)

/**
* @name xtimer configuration values
* @{
Expand All @@ -94,21 +90,16 @@ extern "C" {
* @name Indicate Watchdog cleared in bootloader an
*
* AVR CPUs need to reset the Watchdog as fast as possible.
* This flag indicates that the watchdog is reseted in the bootloader
* This flag indicates that the watchdog is reset in the bootloader
* and that the MCUSR value is stored in register 0 (r0)
* @{
*/
#define BOOTLOADER_CLEARS_WATCHDOG_AND_PASSES_MCUSR 0
/** @} */

/**
* @name CPU clock scale for jiminy-megarfr256rfr2
* @name CPU clock scale for avr-rss2
*
* The CPU can not be used with the external xtal oscillator if the core
* should be put in sleep while the transceiver is in rx mode.
*
* It seems the as teh peripheral clock divider is set to 1 and this all
* clocks of the timer, etc run with 16MHz increasing power consumption.
*/
#define CPU_ATMEGA_CLK_SCALE_INIT CPU_ATMEGA_CLK_SCALE_DIV1
/** @} */
Expand All @@ -123,7 +114,7 @@ extern "C" {

#define BTN0_PRESSED ((BTN0_PIN & BTN0_MASK) == 0)
#define BTN0_RELEASED ((BTN0_PIN & BTN0_MASK) != 0)

/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
Expand Down
16 changes: 0 additions & 16 deletions boards/avr-rss2/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ extern "C" {
#define CLOCK_CORECLOCK (16000000UL)
/** @} */

/**
* @name RTC configuration
* @{
*/
#define RTC_NUMOF (1U)
/** @} */

/**
* @name RTT configuration
* @{
*/
#define RTT_NUMOF (1U)
#define RTT_MAX_VALUE (0x00FFFFFF) /* 24-bit timer */
#define RTT_FREQUENCY (32U)
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
39 changes: 0 additions & 39 deletions boards/avr-rss2/include/rss2.h

This file was deleted.

11 changes: 1 addition & 10 deletions boards/avr-rss2/board.c → boards/avr-rss2/led_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* @ingroup boards_rss2-mega256rfr2
* @ingroup boards_avr-rss2
* @{
*
* @file
Expand All @@ -19,10 +19,6 @@
*/

#include "board.h"
#include "cpu.h"
#include "net/eui64.h"
#include <string.h>
#include <inttypes.h>

void led_init(void)
{
Expand All @@ -31,8 +27,3 @@ void led_init(void)
/* All LEDs OFF */
LED_PORT |= (LED1_MASK | LED0_MASK);
}

void board_init(void)
{
led_init();
}

0 comments on commit bd26c7a

Please sign in to comment.