00001 /* dio.c --- 00002 * 00003 * Filename: dio.c 00004 * Description: 00005 * Author: Bryce Himebaugh 00006 * Maintainer: 00007 * Created: Mon Oct 16 11:01:06 2006 00008 * Version: 00009 * Last-Updated: 00010 * By: 00011 * Update #: 0 00012 * Keywords: 00013 * Compatibility: 00014 * 00015 */ 00016 00017 /* Commentary: 00018 * 00019 * 00020 * 00021 */ 00022 00023 /* Change log: 00024 * 00025 * 00026 */ 00027 00028 /* This program is free software; you can redistribute it and/or modify 00029 * it under the terms of the GNU General Public License as published by 00030 * the Free Software Foundation; either version 2, or (at your option) 00031 * any later version. 00032 * 00033 * This program is distributed in the hope that it will be useful, 00034 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00035 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00036 * GNU General Public License for more details. 00037 * 00038 * You should have received a copy of the GNU General Public License 00039 * along with this program; see the file COPYING. If not, write to the 00040 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00041 * Boston, MA 02111-1307, USA. 00042 */ 00043 00044 /* Code: */ 00045 #include <msp430x16x.h> 00046 00047 void init_dio(void) { 00062 P1DIR = 0x00; 00063 00078 P2DIR = 0x70; 00079 00080 00095 P3SEL = 0xF0; // Select pins 3.4-3.7 as serial port pins 00096 P3DIR = 0x5F; // Make both serial TX pins (3.4 and 3.6) outputs. 00097 P3OUT = 0x0F; // 1 for full rate, 0 for divide by 8 00098 00113 P4SEL = 0x0F; 00114 P4DIR=0xF0; 00115 00130 P5DIR=0xFF; 00131 P5OUT=0xFF; // do NOT use bit 4 (set to 0) as it will kill speed sensors. 00132 00147 P6SEL = 0xFF; // select all of the P6/analog pins as alternate function 00148 P6DIR=0x00; 00149 } 00150 00151 /* dio.c ends here */
1.3.9.1