The Sensor Terminal Board is a carrier board for the radio controller board family. The transceiver wiring fits the common RCBs. The wiring of the radio and the ATmega is shown below:
AVR RF230 --- ----- PB4 --> SLPTR PD6 <-- CLKM PD4 <-- IRQ (ICP1) PB5 --> RSTN PB0 --> SS PB2 --> MOSI PB3 <-- MISO PB1 --> SCK
The STBxxx has memory mapped LEDS and Keys. KEY: PE5 LEDS
You can select between using the LEDs on the RCB or on the STB. In order to use the RCB LEDS, you have to define the macro USE_RCB_LEDS.
The LEDs on STB have a write-only memory interface, so we can't read back the LED status. So we need to have a shadow register, which stores the current LED state. Since the board interface consists only of a header file, we use register GPIO2 on ATmega1281 for shadowing, because it would be hard to ensure the single instantiation of a global variable from a header file, which is used in many module files.
Fuses/Locks: LF: 0xe2 - 8MHz internal RC Osc. HF: 0x11 - without boot loader HF: 0x10 - with boot loader EF: 0xff LOCK: 0xef - protection of boot section
Original Settings w/ rdk231 LF: 0x61 HF: 0x91 EF: 0xfe
Bootloader: Start at byte=0x1e000, address=0xf000, size = 4096 instructions/ 8192 bytes
Definition in file board_stb.h.
Go to the source code of this file.
Defines | |
#define | BOARD_NAME BOARD_NAME_STB2XX |
#define | DEFAULT_SPI_RATE (SPI_RATE_1_2) |
#define | FT245_DDR DDRE |
#define | FT245_INIT() |
#define | FT245_PIN PINE |
#define | FT245_RX_DATA() ((FT245_PIN & FT245_RXF)) |
#define | FT245_RXF _BV(7) |
#define | FT245_TX_DATA() ((FT245_PIN & FT245_TXE)) |
#define | FT245_TXE _BV(6) |
#define | HIF_IO_ENABLE XRAM_ENABLE |
#define | HIF_NO_DATA (0x0100) |
#define | HIF_TYPE (HIF_FT245) |
#define | HWTIMER_REG (TCNT1) |
#define | HWTIMER_TICK ((1.0*HWTMR_PRESCALE)/F_CPU) |
#define | HWTIMER_TICK_NB (0xFFFFUL+1) |
#define | HWTMR_PRESCALE (1) |
#define | INVERSE_KEYS (0) |
#define | KEY_INIT xmem_init |
#define | KEY_IO_AD (0x4000) |
#define | LED_CLR(ln) |
#define | LED_GET_VALUE() ((~LED_SHADOW & LED_MASK) >> LED_SHIFT) |
#define | LED_INIT() |
#define | LED_IO_AD (0x4000) |
#define | LED_MASK (0x03) |
#define | LED_NUMBER (2) |
#define | LED_PORT (*((volatile uint8_t *)(LED_IO_AD))) |
#define | LED_SET(ln) |
#define | LED_SET_VALUE(x) |
#define | LED_SHADOW GPIOR2 |
#define | LED_SHIFT (0) |
#define | LED_TOGGLE(ln) |
#define | LED_VAL(msk, val) |
#define | LEDS_INVERSE (1) |
#define | MASK_KEY (0x1) |
#define | MAX_FRAME_SIZE (127) |
#define | PIN_KEY (*(volatile uint8_t*)(KEY_IO_AD)) |
#define | PULLUP_KEYS (0) |
#define | RX_HAS_DATA (0) |
#define | RX_HAS_NO_DATA (FT245_RXF) |
#define | SHIFT_KEY (0) |
#define | TIMER_INIT() |
#define | TIMER_IRQ_vect TIMER1_OVF_vect |
#define | TIMER_POOL_SIZE (4) |
#define | TIMER_TICK (HWTIMER_TICK_NB * HWTIMER_TICK) |
#define | TUNED_OSCCAL (0xbf) |
#define | TX_IS_BLOCKED (FT245_TXE) |
#define | TX_IS_READY (0) |
#define | USB_FIFO_AD 0x2200 |
#define | xDDR_KEY DDRE |
#define | XRAM_DISABLE() |
#define | XRAM_ENABLE() |
Functions | |
static void | xmem_init (void) |
#define BOARD_NAME BOARD_NAME_STB2XX |
ID String for this hardware
Definition at line 119 of file board_stb.h.
#define FT245_INIT | ( | ) |
Value:
do { \ FT245_DDR &= ~(FT245_TXE|FT245_RXF);\ } while(0)
Definition at line 239 of file board_stb.h.
#define LED_CLR | ( | ln | ) |
Value:
do{\ LED_SHADOW |= (_BV(ln+LED_SHIFT) & LED_MASK);\ LED_PORT = LED_SHADOW;\ }while(0)
Definition at line 178 of file board_stb.h.
#define LED_INIT | ( | ) |
Value:
do{\ xmem_init(); \ LED_SHADOW = LED_MASK;\ LED_PORT = LED_SHADOW;\ }while(0)
Definition at line 156 of file board_stb.h.
#define LED_SET | ( | ln | ) |
Value:
do{\ LED_SHADOW &= ~(_BV(ln+LED_SHIFT) & LED_MASK);\ LED_PORT = LED_SHADOW;\ }while(0)
Definition at line 172 of file board_stb.h.
#define LED_SET_VALUE | ( | x | ) |
Value:
do{\ LED_SHADOW = (LED_SHADOW & ~LED_MASK) | ((~x<<LED_SHIFT) & LED_MASK);\ LED_PORT = LED_SHADOW;\ }while(0)
Definition at line 163 of file board_stb.h.
#define LED_TOGGLE | ( | ln | ) |
Value:
do{\ LED_SHADOW ^= (_BV(ln+LED_SHIFT) & LED_MASK);\ LED_PORT = LED_SHADOW;\ }while(0)
Definition at line 192 of file board_stb.h.
#define LED_VAL | ( | msk, | |||
val | ) |
Value:
do{\ LED_SHADOW &= ~(LED_MASK|(msk<<LED_SHIFT)); \ LED_SHADOW |= ~(val & (LED_MASK|msk));\ LED_PORT = LED_SHADOW;\ }while(0)
Definition at line 184 of file board_stb.h.
#define MAX_FRAME_SIZE (127) |
maximum allowed frame size
Definition at line 123 of file board_stb.h.
#define TIMER_INIT | ( | ) |
Value:
do{ \ TCCR1B |= _BV(CS10); \ TIMSK1 |= _BV(TOIE1); \ }while(0)
Timer is clocked at F_CPU, and TIMER_IRQ_vect is called every 65535 ticks.
Definition at line 269 of file board_stb.h.
#define TIMER_IRQ_vect TIMER1_OVF_vect |
Vector for Timer IRQ routine
Definition at line 258 of file board_stb.h.
#define XRAM_DISABLE | ( | ) |
#define XRAM_ENABLE | ( | ) |
Value:
do {\ DDRC = 0xff; /*force addr 0 to avoid glitches on ext. SRAM*/\ PORTC = 0x00;\ XMCRA |= (1 << SRE);\ XMCRB = (1 << XMBK);\ }while(0)
Definition at line 221 of file board_stb.h.