Skip to content

Commit

Permalink
adding some more information about the msp430f1611
Browse files Browse the repository at this point in the history
  • Loading branch information
anroOfCode committed Nov 15, 2012
1 parent e34d5cf commit eefb1ce
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 79 deletions.
13 changes: 11 additions & 2 deletions hijack/src/include/config.h
Expand Up @@ -16,13 +16,22 @@
*/

#define MSP430FR5969
//#define MSP430F1611

#if defined(MSP430F1611) || defined(MSP430FR5969)
#if defined(MSP430FR5969)

// Used by the coding state machine to identify
// long and short pulses.
#define THRESHOLD 325
#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
16 changes: 16 additions & 0 deletions hijack/src/include/hardware.h
Expand Up @@ -14,13 +14,29 @@
* 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"

#ifndef __HARDWARE_H__
#define __HARDWARE_H__

#ifdef MSP430FR5969

#define LED_0 BIT0
#define LED_OUT P1OUT
#define LED_DIR P1DIR
Expand Down
67 changes: 0 additions & 67 deletions hijack/src/peripherals/msp/sstimer.c

This file was deleted.

58 changes: 48 additions & 10 deletions hijack/src/peripherals/msp/utility.c
Expand Up @@ -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

}
Expand Down

0 comments on commit eefb1ce

Please sign in to comment.