Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding some more information about the msp430f1611

  • Loading branch information...
commit eefb1ced49e05466b1e9a1ac87ac1ecaabd6b2c2 1 parent e34d5cf
@anroOfCode authored
View
13 hijack/src/include/config.h
@@ -16,8 +16,9 @@
*/
#define MSP430FR5969
+//#define MSP430F1611
-#if defined(MSP430F1611) || defined(MSP430FR5969)
+#if defined(MSP430FR5969)
// Used by the coding state machine to identify
// long and short pulses.
@@ -25,4 +26,12 @@
#define DELTAT 775
#endif
-//#define MSP430F1611
+
+#if defined(MSP430F1611)
+
+// Used by the coding state machine to identify
+// long and short pulses.
+#define THRESHOLD 8
+#define DELTAT 17
+
+#endif
View
16 hijack/src/include/hardware.h
@@ -14,6 +14,21 @@
* You should have received a copy of the GNU General Public License
* along with hijack-infinity. If not, see <http://www.gnu.org/licenses/>.
*/
+
+// Hardware Pin Mappings for boards:
+///////////////////////////////////////
+// HIJACK REVD BOARD WITH MSP430F1611:
+//
+// Digital In 1: J4 (left), P1
+// Digital In 2: J4 (left), P2
+// Digital Out 1: J4 (left), P3
+// Digital Out 2: J4 (left), P4
+// Digital Out 3: J4 (left), P5
+// Digital Out 4: J4 (left), P6
+// Analog In 1: J2 (right), P5
+// Analog In 2: J2 (right), P6
+//////////////////////////////////////
+
#include "config.h"
@@ -21,6 +36,7 @@
#define __HARDWARE_H__
#ifdef MSP430FR5969
+
#define LED_0 BIT0
#define LED_OUT P1OUT
#define LED_DIR P1DIR
View
67 hijack/src/peripherals/msp/sstimer.c
@@ -1,67 +0,0 @@
-/*
- * This file is part of hijack-infinity.
- *
- * hijack-infinity is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * hijack-infinity is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with hijack-infinity. If not, see <http://www.gnu.org/licenses/>.
- */
-
-// NOTE: I don't think this file is actually used. Keeping
-// around for legacy purposes.
-
-#if defined(MSP430FR5969) || defined(MSP430F1611)
-
-#include "msp430.h"
-#include <inttypes.h>
-#include "sstimer.h"
-
-uint8_t sstimer_inuse = 0;
-sstimer_callback* sstimer_callback_fn;
-
-void sstimer_init () {
- TA0CCTL0 = CCIE;
- TA0CTL = TASSEL__SMCLK + MC__STOP + ID__8;
-}
-
-void sstimer_set (uint16_t ms, sstimer_callback* cb) {
-
- if (sstimer_inuse) {
- return;
- }
-
- // convert ms to timer tics
-
- // reset timer count
- TA0R = 0x00;
-
- // set count to val
- TA0CCR0 = ms;
-
- // start timer
- TA0CTL |= MC__UP;
-
- // save callback
- sstimer_callback_fn = cb;
- sstimer_inuse = 1;
-}
-
-#pragma vector = TIMER0_A0_VECTOR
-__interrupt void Timer_A (void) {
-
- TA0CTL &= MC__STOP;
-
- sstimer_inuse = 0;
-
- sstimer_callback_fn();
-}
-
-#endif
View
58 hijack/src/peripherals/msp/utility.c
@@ -104,16 +104,54 @@ void util_boardInit(void) {
#ifdef MSP430F1611
- // TODO: Determine best startup
- // state for pins.
-
-/* P1DIR = 0xFF;
- P2DIR = 0xFF;
- P3DIR = 0xFF;
- P4DIR = 0xFF;
- P5DIR = 0xFF;
- P6DIR = 0xFF;
-*/
+ // Pin setup determiend from TinyOS.
+
+ P1SEL = 0;
+ P2SEL = 0;
+ P3SEL = 0;
+ P4SEL = 0;
+ //P5SEL = 0x20; // output SMCLK on P5.5
+ P5SEL = 0;
+ P6SEL = 0;
+
+ P1OUT = 0x00;
+ P1DIR = 0x00;
+
+ P2OUT = 0x00;
+ P2DIR = 0x00;
+
+ P3OUT = 0x00;
+ P3DIR = 0x00;
+
+ P4OUT = 0x00;
+ P4DIR = 0x00;
+
+ P5OUT = 0x00;
+
+ //P5DIR = 0x20;
+ P5DIR = 0x00;
+
+ P6OUT = 0x00;
+ P6DIR = 0x00;
+
+ P1IE = 0;
+ P2IE = 0;
+
+ // Setup Clocks
+ // BCSCTL1
+ // .XT2OFF = 1; disable the external oscillator for SCLK and MCLK
+ // .XTS = 0; set low frequency mode for LXFT1
+ // .DIVA = 0; set the divisor on ACLK to 1
+ // .RSEL, do not modify
+ BCSCTL1 = XT2OFF | (BCSCTL1 & (RSEL2|RSEL1|RSEL0));
+
+ // BCSCTL2
+ // .SELM = 0; select DCOCLK as source for MCLK
+ // .DIVM = 0; set the divisor of MCLK to 1
+ // .SELS = 0; select DCOCLK as source for SCLK
+ // .DIVS = 2; set the divisor of SCLK to 4
+ // .DCOR = 1; select internal resistor for DCO
+ BCSCTL2 = DIVS1 | DCOR;
#endif
}
Please sign in to comment.
Something went wrong with that request. Please try again.