From e116bb2447d7019adbd7102d0b26da093e898122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Wed, 19 Nov 2014 03:14:48 +0100 Subject: [PATCH] added EKG code, since i changed the protocol --- mod_ekg_psychose/gcc/MOD-EKG_DemoSoft.c | 462 ++++ mod_ekg_psychose/gcc/Makefile | 91 + mod_ekg_psychose/gcc/make.sh | 2 + .../iar/Backup of MOD-EKG_DemoSoft.ewd | 571 +++++ .../iar/Backup of MOD-EKG_DemoSoft.ewp | 1744 +++++++++++++ mod_ekg_psychose/iar/MOD-EKG_DemoSoft.c | 436 ++++ mod_ekg_psychose/iar/MOD-EKG_DemoSoft.dep | 128 + mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewd | 819 +++++++ mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewp | 2161 +++++++++++++++++ mod_ekg_psychose/iar/MOD-EKG_DemoSoft.eww | 10 + mod_ekg_psychose/iar/mul.s43 | 110 + mod_ekg_psychose/iar/path.txt | 0 .../settings/MOD-EKG_DemoSoft.Debug.cspy.bat | 24 + .../iar/settings/MOD-EKG_DemoSoft.cspy.bat | 34 + .../iar/settings/MOD-EKG_DemoSoft.dbgdt | 89 + .../iar/settings/MOD-EKG_DemoSoft.dni | 94 + .../iar/settings/MOD-EKG_DemoSoft.wsdt | 77 + .../iar/settings/MOD-EKG_DemoSoft.wspos | 2 + 18 files changed, 6854 insertions(+) create mode 100644 mod_ekg_psychose/gcc/MOD-EKG_DemoSoft.c create mode 100644 mod_ekg_psychose/gcc/Makefile create mode 100755 mod_ekg_psychose/gcc/make.sh create mode 100644 mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewd create mode 100644 mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewp create mode 100644 mod_ekg_psychose/iar/MOD-EKG_DemoSoft.c create mode 100644 mod_ekg_psychose/iar/MOD-EKG_DemoSoft.dep create mode 100644 mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewd create mode 100644 mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewp create mode 100644 mod_ekg_psychose/iar/MOD-EKG_DemoSoft.eww create mode 100644 mod_ekg_psychose/iar/mul.s43 create mode 100644 mod_ekg_psychose/iar/path.txt create mode 100644 mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.Debug.cspy.bat create mode 100644 mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.cspy.bat create mode 100644 mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dbgdt create mode 100644 mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dni create mode 100644 mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wsdt create mode 100644 mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wspos diff --git a/mod_ekg_psychose/gcc/MOD-EKG_DemoSoft.c b/mod_ekg_psychose/gcc/MOD-EKG_DemoSoft.c new file mode 100644 index 0000000..ed8deac --- /dev/null +++ b/mod_ekg_psychose/gcc/MOD-EKG_DemoSoft.c @@ -0,0 +1,462 @@ +//***************************************************************************** +// MSP430FG439-Heart Rate Monitor Demo +// +// Description; Uses one Instrumentation Amplifier INA321 and the three +// internal opamps of the MSP430FG439 +// +// Murugavel Raju +// Texas Instruments, Inc +// October 2004 +// Edited by: M Morales, November 2008 +// * Updated to non-depracated intrinsic functions +// * Changed spacing for legibility +// Edited by: +// Penko T. Bozhkov - Olimex LTD, 05.10.2012 +// * RTC capcitors changed according to Olimex's crystall requirements +// * Olimex LCD definitions are added and heart rate is visualized at 2 places on LCD +// Built with IAR Embedded Workbench Version: 4.21 +//***************************************************************************** +//***************************************************************************** +// THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR +// REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, +// INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR +// COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. +// TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET +// POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY +// INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR +// YOUR USE OF THE PROGRAM. +// +// IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +// CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY +// THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED +// OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT +// OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. +// EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF +// REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS +// OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF +// USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S +// AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF +// YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS +// (U.S.$500). +// +// Unless otherwise stated, the Program written and copyrighted +// by Texas Instruments is distributed as "freeware". You may, +// only under TI's copyright in the Program, use and modify the +// Program without any charge or restriction. You may +// distribute to third parties, provided that you transfer a +// copy of this license to the third party and the third party +// agrees to these terms by its first use of the Program. You +// must reproduce the copyright notice and any other legend of +// ownership on each copy or partial copy, of the Program. +// +// You acknowledge and agree that the Program contains +// copyrighted material, trade secrets and other TI proprietary +// information and is protected by copyright laws, +// international copyright treaties, and trade secret laws, as +// well as other intellectual property laws. To protect TI's +// rights in the Program, you agree not to decompile, reverse +// engineer, disassemble or otherwise translate any object code +// versions of the Program to a human-readable form. You agree +// that in no event will you alter, remove or destroy any +// copyright notice included in the Program. TI reserves all +// rights not specifically granted under this license. Except +// as specifically provided herein, nothing in this agreement +// shall be construed as conferring by implication, estoppel, +// or otherwise, upon you, any license or other right under any +// TI patents, copyrights or trade secrets. +// +// You may not use the Program in non-TI devices. +//***************************************************************************** +#include "msp430fg439.h" +#include "math.h" +//defines +#define PB_2_0 (1 << 0) // Push Button on P2.0 +#define PB_2_1 (1 << 1) // Push Button on P2.1 + +// variables declaration +static char beats; +int i=0, first_detection=0; +long result = 0; +int Datain, Dataout, Dataout_pulse, pulseperiod, counter, heartrate; +int heartrate_buffer[] = {0,0,0,0,0,0,0,0,0,0}; +int heartrate_cursor = 0, heartrate_mean; + +// Lowpass FIR filter coefficients for 17 taps to filter > 30Hz +static const int coeffslp[9] = { + 5225, 5175, 7255, 9453, 11595, 13507, 15016, 15983, 16315 }; +// Highpass FIR filter coefficients for 17 taps to filter < 2Hz +static const int coeffshp[9] = { + -763, -1267, -1091, -1867, -1969, -2507, -2619, -2911, 29908 }; + +// ******************************************* +// Definitions related to Olimex LCD Digits!!!! +// ******************************************* +// Definitions for Olimex LCD digits 10 and 11 +#define a 0x10 +#define b 0x01 +#define c 0x04 +#define d 0x08 +#define e 0x40 +#define f 0x20 +#define g 0x02 +#define h 0x80 +// Character generator definition for display digits 10 and 11 +const char char_gen_10_11[] = { + a+b+c+d+e+f, // 0 Displays "0" + b+c, // 1 Displays "1" + a+b+d+e+g, // 2 Displays "2" + a+b+c+d+g, // 3 Displays "3" + b+c+f+g, // 4 Displays "4" + a+c+d+f+g, // 5 Displays "5" + a+c+d+e+f+g, // 6 Displays "6" + a+b+c, // 7 Displays "7" + a+b+c+d+e+f+g, // 8 Displays "8" + a+b+c+d+f+g, // 9 Displays "9" +}; +// undefines +#undef a +#undef b +#undef c +#undef d +#undef e +#undef f +#undef g +#undef h + +// Definitions for Olimex LCD digits 8 and 9 +#define a 0x01 +#define b 0x02 +#define c 0x04 +#define d 0x80 +#define e 0x40 +#define f 0x10 +#define g 0x20 +#define h 0x08 +// Character generator definition for display digits 8 and 9 +const char char_gen_8_9[] = { + a+b+c+d+e+f, // 0 Displays "0" + b+c, // 1 Displays "1" + a+b+d+e+g, // 2 Displays "2" + a+b+c+d+g, // 3 Displays "3" + b+c+f+g, // 4 Displays "4" + a+c+d+f+g, // 5 Displays "5" + a+c+d+e+f+g, // 6 Displays "6" + a+b+c, // 7 Displays "7" + a+b+c+d+e+f+g, // 8 Displays "8" + a+b+c+d+f+g, // 9 Displays "9" +}; +// undefines +#undef a +#undef b +#undef c +#undef d +#undef e +#undef f +#undef g +#undef h + +// Definitions for Olimex LCD digits 1 to 7. Here each digit definition require 2 bytes +#define a 0x0080 +#define b 0x0040 +#define c 0x0020 +#define d 0x0010 +#define e 0x2000 +#define f 0x4000 +#define g 0x0402 +#define h 0x1000 +// Character generator definition for display digits 1 to 7 +const int char_gen_1_7[] = { + a+b+c+d+e+f, // 0 Displays "0" + b+c, // 1 Displays "1" + a+b+d+e+g, // 2 Displays "2" + a+b+c+d+g, // 3 Displays "3" + b+c+f+g, // 4 Displays "4" + a+c+d+f+g, // 5 Displays "5" + a+c+d+e+f+g, // 6 Displays "6" + a+b+c, // 7 Displays "7" + a+b+c+d+e+f+g, // 8 Displays "8" + a+b+c+d+f+g, // 9 Displays "9" +}; +// undefines +#undef a +#undef b +#undef c +#undef d +#undef e +#undef f +#undef g +#undef h + + + +// function prototypes +void Init(void); // Initializes device for the application +void ClearLCD(void); // Clears the LCD memory +int filterlp(int); // 17 tap lowpass FIR filter +int filterhp(int); // 17 tap highpass FIR filter +long mul16(register int x, register int y); // 16-bit signed multiplication +int itobcd(int i); // 16-bit hex to bcd conversion + +// main function +int main(void) +{ + Init(); // Initialize device for the application + LCDMEM[7] = 0x80; // Turn on LCD's Olimex row!!! + +/* + // For debug purpose only! + for(unsigned char j=0;j<10;j++){ + LCDMEM[2] = char_gen_10_11[j]; // LCD -> Digit 11 + LCDMEM[3] = char_gen_10_11[j]; // LCD -> Digit 10 + LCDMEM[4] = char_gen_8_9[j]; // LCD -> Digit 9 + LCDMEM[5] = char_gen_8_9[j]; // LCD -> Digit 8 + + LCDMEM[7] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 7 High Byte + LCDMEM[6] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 7 Low Byte + LCDMEM[9] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 6 High Byte + LCDMEM[8] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 6 Low Byte + LCDMEM[11] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 5 High Byte + LCDMEM[10] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 5 Low Byte + //LCDMEM[13] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 4 High Byte + //LCDMEM[12] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 4 Low Byte + //LCDMEM[15] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 3 High Byte + //LCDMEM[14] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 3 Low Byte + //LCDMEM[17] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 2 High Byte + //LCDMEM[16] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 2 Low Byte + } +*/ + + while(1) + { + __bis_SR_register(LPM0_bits); // Enter LPM0 needed for UART TX completion + __no_operation(); + + Dataout = filterlp(Datain); // Lowpass FIR filter for filtering out 60Hz + Dataout_pulse = filterhp(Dataout)-128; // Highpass FIR filter to filter muscle artifacts + Dataout = Dataout >> 6; // Scale Dataout to use scope program + if(Dataout > 255) Dataout = 255; // Set boundary 255 max + if(Dataout < 0) Dataout = 0; // Set boundary 0 min + //DAC12_0DAT = Dataout; // For scope display + + + if( 0 ) { + TXBUF0 = Dataout; // Transmit via UART0 for Scope display + } else { + // send the data as ascii values + TXBUF0 = (Dataout / 100) + 48; // hundreds + while (!(IFG1 & UTXIFG0)); // wait for transmission + TXBUF0 = ((Dataout / 10) % 10 ) + 48; // tens + while (!(IFG1 & UTXIFG0)); + TXBUF0 = ((Dataout / 1) % 10 ) + 48; // ones + while (!(IFG1 & UTXIFG0)); + TXBUF0 = 32; // send a blank + while (!(IFG1 & UTXIFG0)); + TXBUF0 = ((heartrate & 0xf00) >> 8) + 48; + while (!(IFG1 & UTXIFG0)); + TXBUF0 = ((heartrate & 0xf0) >> 4) + 48; + while (!(IFG1 & UTXIFG0)); + TXBUF0 = (heartrate & 0x0f) + 48; + while (!(IFG1 & UTXIFG0)); + TXBUF0 = 10; // send a \n + } + + + counter++; // Debounce counter + pulseperiod++; // Pulse period counter + if (Dataout_pulse > 100) // Check if above threshold (48) + { + LCDMEM[1] = 0xF0; // Heart beat detected enable "<^>" on LCD + counter = 0; // Reset debounce counter + } + if (counter == 128) // Allow 128 sample debounce time + { + LCDMEM[1] = 0x00; // Disable "<^>" on LCD for blinking effect + beats++; + if (beats == 3) + { + beats = 0; + + //heartrate_buffer[heartrate_cursor] = 50720/pulseperiod; + //heartrate_cursor++; + //heartrate_cursor = heartrate_cursor % 10; + + //int ct; + //for(ct = 0; ct < 10; ct++) { +// heartrate_mean += heartrate_buffer[ct]; + //} + //heartrate = itobcd(heartrate_mean / 10); + + // heartrate = itobcd(30720/pulseperiod); // Calculate beat to beat heart rate per min + //heartrate = itobcd(92160/pulseperiod); // Calculate 3 beat average heart rate per min + heartrate = itobcd(50720/pulseperiod); // Calculate 3 beat average heart rate per min + //heartrate = (92160/pulseperiod); // Calculate 3 beat average heart rate per min + pulseperiod = 0; // Reset pulse period for next measurement + + + + ///* + LCDMEM[2] = char_gen_10_11[heartrate & 0x0f]; // Display current heart rate units -> LCD Digit 11 + LCDMEM[3] = char_gen_10_11[(heartrate & 0xf0) >> 4]; // tens -> LCD Digit 10 + LCDMEM[4] = char_gen_8_9[(heartrate & 0xf00) >> 8]; // hundreds -> LCD Digit 9 + + LCDMEM[7] = ((char)(char_gen_1_7[heartrate & 0x0f]>>8)); // LCD -> Digit 7 High Byte + LCDMEM[6] = ((char)(char_gen_1_7[heartrate & 0x0f]&0x00FF)); // LCD -> Digit 7 Low Byte + LCDMEM[9] = ((char)(char_gen_1_7[((heartrate & 0xf0) >> 4)]>>8)); // LCD -> Digit 6 High Byte + LCDMEM[8] = ((char)(char_gen_1_7[((heartrate & 0xf0) >> 4)]&0x00FF)); // LCD -> Digit 6 Low Byte + LCDMEM[11] = ((char)(char_gen_1_7[((heartrate & 0xf00) >> 8)]>>8)); // LCD -> Digit 5 High Byte + LCDMEM[10] = ((char)(char_gen_1_7[((heartrate & 0xf00) >> 8)]&0x00FF)); // LCD -> Digit 5 Low Byte + //*/ + + } + } + } +}//main + +// Initialization function +void Init( void ) +{ + FLL_CTL0 |= XCAP10PF; // Set load capacitance for xtal + WDTCTL = WDTPW | WDTHOLD; // Disable the Watchdog + while ( LFOF & FLL_CTL0); // wait for watch crystal to stabilize + SCFQCTL = 63; // 32 x 32768 x 2 = 2.097152MHz + BTCTL = BT_fLCD_DIV128; // Set LCD frame freq = ACLK/128 +// Initialize and enable LCD peripheral + ClearLCD(); // Clear LCD memory + LCDCTL = LCDSG0_3 + LCD4MUX + LCDON ; // 4mux LCD, segs0-23 enabled +// Initialize and enable GPIO ports + P1OUT = 0x00 + BIT3; // Clear P1OUT register, INA turned ON + P1DIR = 0x3f; // Unused pins as outputs, Comparator pins as inputs + P2OUT = 0x00; // Clear P2OUT register + P2DIR = 0xff; // Unused pins as outputs + P2DIR = ~(PB_2_0+PB_2_1); // P2.0 and P2.1 push buttons + P2IES = 0x00; // Interrupt edge low to high transition + P2IFG = 0x00; // Clear pending P2 interrupts + P2IE = PB_2_0 | PB_2_1; // Enable intterupts for push buttons + P3OUT = 0x00; // Clear P3OUT register + P3DIR = 0x0f; // Unused pins as outputs except P3.<4-7> -> For the new LCD's received at ~04.10.2012 this must be inputs!! + P4OUT = 0x00; // Clear P4OUT register + P4DIR = 0xff; // Unused pins as outputs + P5OUT = 0x00; // Clear P5OUT register + P5DIR = 0xff; // Unused pins as outputs + P5SEL = 0xfc; // Set Rxx and COM pins for LCD + P6OUT = 0x00; // Clear P6OUT register + P6SEL = 0xff; // P6 = Analog +// Initialize and enable UART + P2SEL|=BIT4; // P2.4 = TXD + UCTL0 |= SWRST; // UART SWRST = 1 + ME1 |= UTXE0; // Enable UART0 TXD + UCTL0 |= CHAR; // 8-bit char, SWRST=1 + UTCTL0 |= SSEL1; // UCLK = SMCLK + UBR00 = 18; // 115200 from 2.097152MHz + UBR10 = 0; + UMCTL0 = 0x2c; // Modulation = 0.2044 + UCTL0 &= ~SWRST; // UART SWRST = 0, enable UART + IFG1 &= ~UTXIFG0; +// Initialize and enable ADC12 + ADC12CTL0 = ADC12ON + SHT0_4 + REFON + REF2_5V; + // ADC12 ON, Reference = 2.5V for DAC0 + ADC12CTL1 = SHP + SHS_1 + CONSEQ_2; // Use sampling timer, TA1 trigger + ADC12MCTL0 = INCH_1 + SREF_1; // Vref, channel = 1 = OA0 Out + ADC12IE = BIT0; // Enable interrupt for ADC12 MEM0 + ADC12CTL0 |= ENC; // Enable conversions +// Initialize and enable Timer_A + TACTL = TASSEL0 + MC_1 + TACLR; // ACLK, Clear TAR, Up Mode + TACCTL1 = OUTMOD_2; // Set / Reset + TACCR0 = 63; // 512 samples per second + TACCR1 = 15; // +// Initialize and enable DAC12x + DAC12_0CTL = DAC12OPS + DAC12CALON + DAC12IR + DAC12AMP_2 + DAC12ENC;// DAC0 enable + DAC12_1CTL = DAC12CALON + DAC12IR + DAC12AMP_2 + DAC12ENC; // DAC1 enable + DAC12_1DAT = 0x099A; // Offset level = 1.5V for op amp bias +// Initialize and enable opamps + OA0CTL0 = OAP_1 + OAPM_1 + OAADC1; // OA0 enable power mode 1, OA0- = P6.0, 0A0+ = P6.2, OA0O = P6.1 + OA0CTL1 = OARRIP; // General purpose mode, no Rail-to-Rail inputs + OA1CTL0 = OAP_3 + OAPM_1 + OAADC1; // OA1 enable power mode 1, OA1- = P6.4, OA1+ = DAC1, OA1O = P6.3 + OA1CTL1 = OARRIP; // General purpose mode, no Rail-to-Rail inputs + OA2CTL0 = OAP_3 + OAPM_1 + OAADC1; // OA2 enable power mode 1, OA2+ = DAC1, OA2O = P6.5, Select inputs, power mode + OA2CTL1 = OAFC_1 + OARRIP; // Unit gain Mode, no Rail-to-Rail inputs + __enable_interrupt(); // Enable global Interrupts +} //init + +void ClearLCD(void) +{ + int i; // + for( i = 0; i < 20; i++){ // Clear LCDMEM + LCDMEM[i] = 0; // + } +}//clear LCD + +int itobcd(int i) // Convert hex word to BCD. +{ + int bcd = 0; // + char j = 0; // + + while (i > 9) // + { + bcd |= ((i % 10) << j); // + i /= 10; // + j += 4; + } // + return (bcd | (i << j)); // Return converted value +}// itobcd(i) + + +int filterlp(int sample) // Lowpass FIR filter for EKG +{ + static int buflp[32]; // Reserve 32 loactions for circular buffering + static int offsetlp = 0; + long z; + int i; + + buflp[offsetlp] = sample; + z = mul16(coeffslp[8], buflp[(offsetlp - 8) & 0x1F]); + + __no_operation(); + + for (i = 0; i < 8; i++){ + z += mul16(coeffslp[i], buflp[(offsetlp - i) & 0x1F] + buflp[(offsetlp - 16 + i) & 0x1F]); + } + + offsetlp = (offsetlp + 1) & 0x1F; + return z >> 15; // Return filter output +}// int filter + +int filterhp(int samplehp) // Highpass FIR filter for hear rate +{ + static int bufhp[32]; // Reserve 32 loactions for circular buffering + static int offsethp = 0; + long z; + int i; + + bufhp[offsethp] = samplehp; + z = mul16(coeffshp[8], bufhp[(offsethp - 8) & 0x1F]); + + for (i = 0; i < 8; i++){ + z += mul16(coeffshp[i], bufhp[(offsethp - i) & 0x1F] + bufhp[(offsethp - 16 + i) & 0x1F]); + } + + offsethp = (offsethp + 1) & 0x1F; + return z >> 15; // Return filter output +}// int filterhp + +long mul16(register int x, register int y) +{ + return ((long)x) * y; +} + + +#pragma vector = PORT2_VECTOR +__interrupt void Port2ISR (void) +{ + P2IFG = 0; +}//Push buttons unused + +#pragma vector = ADC_VECTOR // ADC12 ISR +__interrupt void ADC12ISR (void) +{ + Datain = ADC12MEM0; // Store converted value in Datain + __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 on return +}// ADC12ISR + + diff --git a/mod_ekg_psychose/gcc/Makefile b/mod_ekg_psychose/gcc/Makefile new file mode 100644 index 0000000..08dfffa --- /dev/null +++ b/mod_ekg_psychose/gcc/Makefile @@ -0,0 +1,91 @@ +# +# Makefile for msp430 +# +# 'make' builds everything +# 'make clean' deletes everything except source files and Makefile +# You need to set TARGET, MCU and SOURCES for your project. +# TARGET is the name of the executable file to be produced +# $(TARGET).elf $(TARGET).hex and $(TARGET).txt nad $(TARGET).map are all generated. +# The TXT file is used for BSL loading, the ELF can be used for JTAG use +# +TARGET = mod-pulse-ekg +MCU = msp430fg439 + +# List all the source files here +# eg if you have a source file foo.c then list it here +SOURCES = MOD-EKG_DemoSoft.c +# Include are located in the Include directory +INCLUDES = -IInclude + +# Add or subtract whatever MSPGCC flags you want. There are plenty more +####################################################################################### +CFLAGS = -mmcu=$(MCU) -g -Os -Wall -Wunused $(INCLUDES) +ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp -Wa,-gstabs +LDFLAGS = -mmcu=$(MCU) -Wl,-Map=$(TARGET).map -lm -lfp -pipe +######################################################################################## +CC = msp430-gcc +LD = msp430-ld +AR = msp430-ar +AS = msp430-gcc +GASP = msp430-gasp +NM = msp430-nm +OBJCOPY = msp430-objcopy +RANLIB = msp430-ranlib +STRIP = msp430-strip +SIZE = msp430-size +READELF = msp430-readelf +MAKETXT = srec_cat +CP = cp -p +RM = rm -f +MV = mv +######################################################################################## +# the file which will include dependencies + +DEPEND = $(SOURCES:.c=.d) + +# all the object files +OBJECTS = $(SOURCES:.c=.o) + +#all: $(TARGET).elf $(TARGET).hex $(TARGET).txt +all: $(TARGET).elf $(TARGET).hex +$(TARGET).elf: $(OBJECTS) + echo "Linking $@" + $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@ + echo + echo ">>>> Size of Firmware <<<<" + $(SIZE) $(TARGET).elf + echo + +%.hex: %.elf + $(OBJCOPY) -O ihex $< $@ + +#%.txt: %.hex +# $(MAKETXT) -O $@ -TITXT $< -I +# unix2dos $(TARGET).txt +# The above line is required for the DOS based TI BSL tool to be able to read the txt file generated from linux/unix systems. + +%.o: %.c + echo "Compiling $<" + $(CC) -c $(CFLAGS) -o $@ $< + +# rule for making assembler source listing, to see the code +%.lst: %.c + $(CC) -c $(ASFLAGS) -Wa,-anlhd $< > $@ + +# include the dependencies unless we're going to clean, then forget about them. +ifneq ($(MAKECMDGOALS), clean) +-include $(DEPEND) +endif +# dependencies file +# includes also considered, since some of these are our own +# (otherwise use -MM instead of -M) +%.d: %.c + echo "Generating dependencies $@ from $<" + $(CC) -M ${CFLAGS} $< >$@ +.SILENT: +.PHONY: clean +clean: + -$(RM) $(OBJECTS) + -$(RM) $(TARGET).* + -$(RM) $(SOURCES:.c=.lst) + -$(RM) $(DEPEND) diff --git a/mod_ekg_psychose/gcc/make.sh b/mod_ekg_psychose/gcc/make.sh new file mode 100755 index 0000000..736a772 --- /dev/null +++ b/mod_ekg_psychose/gcc/make.sh @@ -0,0 +1,2 @@ +msp430-gcc -I/usr/msp430/include -Wall mod_ -mmcu=msp430fg439 -o mod-ekg-pyschose -L /usr/msp430/lib/ldscripts/msp430fg439 -lm -lfp -pipe + diff --git a/mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewd b/mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewd new file mode 100644 index 0000000..a46677a --- /dev/null +++ b/mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewd @@ -0,0 +1,571 @@ + + + + 2 + + Debug + + MSP430 + + 1 + + C-SPY + 4 + + 23 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 430FET + 1 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIM430 + 1 + + 3 + 1 + 1 + + + + + + + + $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin + 1 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + + + Release + + MSP430 + + 0 + + C-SPY + 4 + + 23 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 430FET + 1 + + 15 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIM430 + 1 + + 3 + 1 + 0 + + + + + + + + $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin + 1 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + + + + diff --git a/mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewp b/mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewp new file mode 100644 index 0000000..36b8bcb --- /dev/null +++ b/mod_ekg_psychose/iar/Backup of MOD-EKG_DemoSoft.ewp @@ -0,0 +1,1744 @@ + + + + 2 + + Debug + + MSP430 + + 1 + + General + 7 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICC430 + 4 + + 28 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A430 + 4 + + 13 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + XLINK + 4 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XAR + 4 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + MSP430 + + 0 + + General + 7 + + 26 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICC430 + 4 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A430 + 4 + + 13 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + XLINK + 4 + + 22 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XAR + 4 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + $PROJ_DIR$\MOD-EKG_DemoSoft.c + + + $PROJ_DIR$\mul.s43 + + + + diff --git a/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.c b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.c new file mode 100644 index 0000000..6db8d34 --- /dev/null +++ b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.c @@ -0,0 +1,436 @@ +//***************************************************************************** +// MSP430FG439-Heart Rate Monitor Demo +// +// Description; Uses one Instrumentation Amplifier INA321 and the three +// internal opamps of the MSP430FG439 +// +// Murugavel Raju +// Texas Instruments, Inc +// October 2004 +// Edited by: M Morales, November 2008 +// * Updated to non-depracated intrinsic functions +// * Changed spacing for legibility +// Edited by: +// Penko T. Bozhkov - Olimex LTD, 05.10.2012 +// * RTC capcitors changed according to Olimex's crystall requirements +// * Olimex LCD definitions are added and heart rate is visualized at 2 places on LCD +// Built with IAR Embedded Workbench Version: 4.21 +//***************************************************************************** +//***************************************************************************** +// THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR +// REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, +// INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR +// COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. +// TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET +// POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY +// INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR +// YOUR USE OF THE PROGRAM. +// +// IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +// CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY +// THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED +// OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT +// OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. +// EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF +// REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS +// OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF +// USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S +// AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF +// YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS +// (U.S.$500). +// +// Unless otherwise stated, the Program written and copyrighted +// by Texas Instruments is distributed as "freeware". You may, +// only under TI's copyright in the Program, use and modify the +// Program without any charge or restriction. You may +// distribute to third parties, provided that you transfer a +// copy of this license to the third party and the third party +// agrees to these terms by its first use of the Program. You +// must reproduce the copyright notice and any other legend of +// ownership on each copy or partial copy, of the Program. +// +// You acknowledge and agree that the Program contains +// copyrighted material, trade secrets and other TI proprietary +// information and is protected by copyright laws, +// international copyright treaties, and trade secret laws, as +// well as other intellectual property laws. To protect TI's +// rights in the Program, you agree not to decompile, reverse +// engineer, disassemble or otherwise translate any object code +// versions of the Program to a human-readable form. You agree +// that in no event will you alter, remove or destroy any +// copyright notice included in the Program. TI reserves all +// rights not specifically granted under this license. Except +// as specifically provided herein, nothing in this agreement +// shall be construed as conferring by implication, estoppel, +// or otherwise, upon you, any license or other right under any +// TI patents, copyrights or trade secrets. +// +// You may not use the Program in non-TI devices. +//***************************************************************************** +#include +#include "math.h" +//defines +#define PB_2_0 (1 << 0) // Push Button on P2.0 +#define PB_2_1 (1 << 1) // Push Button on P2.1 + +// variables declaration +static char beats; +int i=0, first_detection=0; +long result = 0; +int Datain, Dataout, Dataout_pulse, pulseperiod, counter, heartrate; +int Heart_Rate_Buffer[] = {0,0,0,0}; +// Lowpass FIR filter coefficients for 17 taps to filter > 30Hz +static const int coeffslp[9] = { + 5225, 5175, 7255, 9453, 11595, 13507, 15016, 15983, 16315 }; +// Highpass FIR filter coefficients for 17 taps to filter < 2Hz +static const int coeffshp[9] = { + -763, -1267, -1091, -1867, -1969, -2507, -2619, -2911, 29908 }; + +// ******************************************* +// Definitions related to Olimex LCD Digits!!!! +// ******************************************* +// Definitions for Olimex LCD digits 10 and 11 +#define a 0x10 +#define b 0x01 +#define c 0x04 +#define d 0x08 +#define e 0x40 +#define f 0x20 +#define g 0x02 +#define h 0x80 +// Character generator definition for display digits 10 and 11 +const char char_gen_10_11[] = { + a+b+c+d+e+f, // 0 Displays "0" + b+c, // 1 Displays "1" + a+b+d+e+g, // 2 Displays "2" + a+b+c+d+g, // 3 Displays "3" + b+c+f+g, // 4 Displays "4" + a+c+d+f+g, // 5 Displays "5" + a+c+d+e+f+g, // 6 Displays "6" + a+b+c, // 7 Displays "7" + a+b+c+d+e+f+g, // 8 Displays "8" + a+b+c+d+f+g, // 9 Displays "9" +}; +// undefines +#undef a +#undef b +#undef c +#undef d +#undef e +#undef f +#undef g +#undef h + +// Definitions for Olimex LCD digits 8 and 9 +#define a 0x01 +#define b 0x02 +#define c 0x04 +#define d 0x80 +#define e 0x40 +#define f 0x10 +#define g 0x20 +#define h 0x08 +// Character generator definition for display digits 8 and 9 +const char char_gen_8_9[] = { + a+b+c+d+e+f, // 0 Displays "0" + b+c, // 1 Displays "1" + a+b+d+e+g, // 2 Displays "2" + a+b+c+d+g, // 3 Displays "3" + b+c+f+g, // 4 Displays "4" + a+c+d+f+g, // 5 Displays "5" + a+c+d+e+f+g, // 6 Displays "6" + a+b+c, // 7 Displays "7" + a+b+c+d+e+f+g, // 8 Displays "8" + a+b+c+d+f+g, // 9 Displays "9" +}; +// undefines +#undef a +#undef b +#undef c +#undef d +#undef e +#undef f +#undef g +#undef h + +// Definitions for Olimex LCD digits 1 to 7. Here each digit definition require 2 bytes +#define a 0x0080 +#define b 0x0040 +#define c 0x0020 +#define d 0x0010 +#define e 0x2000 +#define f 0x4000 +#define g 0x0402 +#define h 0x1000 +// Character generator definition for display digits 1 to 7 +const int char_gen_1_7[] = { + a+b+c+d+e+f, // 0 Displays "0" + b+c, // 1 Displays "1" + a+b+d+e+g, // 2 Displays "2" + a+b+c+d+g, // 3 Displays "3" + b+c+f+g, // 4 Displays "4" + a+c+d+f+g, // 5 Displays "5" + a+c+d+e+f+g, // 6 Displays "6" + a+b+c, // 7 Displays "7" + a+b+c+d+e+f+g, // 8 Displays "8" + a+b+c+d+f+g, // 9 Displays "9" +}; +// undefines +#undef a +#undef b +#undef c +#undef d +#undef e +#undef f +#undef g +#undef h + + + +// function prototypes +void Init(void); // Initializes device for the application +void ClearLCD(void); // Clears the LCD memory +int filterlp(int); // 17 tap lowpass FIR filter +int filterhp(int); // 17 tap highpass FIR filter +long mul16(register int x, register int y); // 16-bit signed multiplication +int itobcd(int i); // 16-bit hex to bcd conversion +// main function +void main(void) +{ + Init(); // Initialize device for the application + LCDMEM[7] = 0x80; // Turn on LCD's Olimex row!!! + +/* + // For debug purpose only! + for(unsigned char j=0;j<10;j++){ + LCDMEM[2] = char_gen_10_11[j]; // LCD -> Digit 11 + LCDMEM[3] = char_gen_10_11[j]; // LCD -> Digit 10 + LCDMEM[4] = char_gen_8_9[j]; // LCD -> Digit 9 + LCDMEM[5] = char_gen_8_9[j]; // LCD -> Digit 8 + + LCDMEM[7] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 7 High Byte + LCDMEM[6] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 7 Low Byte + LCDMEM[9] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 6 High Byte + LCDMEM[8] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 6 Low Byte + LCDMEM[11] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 5 High Byte + LCDMEM[10] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 5 Low Byte + //LCDMEM[13] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 4 High Byte + //LCDMEM[12] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 4 Low Byte + //LCDMEM[15] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 3 High Byte + //LCDMEM[14] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 3 Low Byte + //LCDMEM[17] = ((char)(char_gen_1_7[j]>>8)); // LCD -> Digit 2 High Byte + //LCDMEM[16] = ((char)(char_gen_1_7[j]&0x00FF)); // LCD -> Digit 2 Low Byte + } +*/ + + while(1) + { + __bis_SR_register(LPM0_bits); // Enter LPM0 needed for UART TX completion + __no_operation(); + + Dataout = filterlp(Datain); // Lowpass FIR filter for filtering out 60Hz + Dataout_pulse = filterhp(Dataout)-128; // Highpass FIR filter to filter muscle artifacts + Dataout = Dataout >> 6; // Scale Dataout to use scope program + if(Dataout > 255) Dataout = 255; // Set boundary 255 max + if(Dataout < 0) Dataout = 0; // Set boundary 0 min + //DAC12_0DAT = Dataout; // For scope display + //TXBUF0 = Dataout; // Transmit via UART0 for Scope display + + // send the data as ascii values + TXBUF0 = (Dataout / 100) + 48; // hundreds + while (!(IFG1 & UTXIFG0)); // wait for transmission + TXBUF0 = ((Dataout / 10) % 10 ) + 48; // tens + while (!(IFG1 & UTXIFG0)); + TXBUF0 = ((Dataout / 1) % 10 ) + 48; // ones + while (!(IFG1 & UTXIFG0)); + TXBUF0 = 32; // send a blank + while (!(IFG1 & UTXIFG0)); + TXBUF0 = ((heartrate & 0xf00) >> 8) + 48; + while (!(IFG1 & UTXIFG0)); + TXBUF0 = ((heartrate & 0xf0) >> 4) + 48; + while (!(IFG1 & UTXIFG0)); + TXBUF0 = (heartrate & 0x0f) + 48; + while (!(IFG1 & UTXIFG0)); + TXBUF0 = 10; // send a \n + + + counter++; // Debounce counter + pulseperiod++; // Pulse period counter + if (Dataout_pulse > 110) // Check if above threshold (48) + { + LCDMEM[1] = 0xF0; // Heart beat detected enable "<^>" on LCD + counter = 0; // Reset debounce counter + } + if (counter == 128) // Allow 128 sample debounce time + { + LCDMEM[1] = 0x00; // Disable "<^>" on LCD for blinking effect + beats++; + if (beats == 3) + { + beats = 0; + // heartrate = itobcd(30720/pulseperiod); // Calculate beat to beat heart rate per min + //heartrate = itobcd(92160/pulseperiod); // Calculate 3 beat average heart rate per min + heartrate = itobcd(50720/pulseperiod); // Calculate 3 beat average heart rate per min + //heartrate = (92160/pulseperiod); // Calculate 3 beat average heart rate per min + pulseperiod = 0; // Reset pulse period for next measurement + + ///* + LCDMEM[2] = char_gen_10_11[heartrate & 0x0f]; // Display current heart rate units -> LCD Digit 11 + LCDMEM[3] = char_gen_10_11[(heartrate & 0xf0) >> 4]; // tens -> LCD Digit 10 + LCDMEM[4] = char_gen_8_9[(heartrate & 0xf00) >> 8]; // hundreds -> LCD Digit 9 + + LCDMEM[7] = ((char)(char_gen_1_7[heartrate & 0x0f]>>8)); // LCD -> Digit 7 High Byte + LCDMEM[6] = ((char)(char_gen_1_7[heartrate & 0x0f]&0x00FF)); // LCD -> Digit 7 Low Byte + LCDMEM[9] = ((char)(char_gen_1_7[((heartrate & 0xf0) >> 4)]>>8)); // LCD -> Digit 6 High Byte + LCDMEM[8] = ((char)(char_gen_1_7[((heartrate & 0xf0) >> 4)]&0x00FF)); // LCD -> Digit 6 Low Byte + LCDMEM[11] = ((char)(char_gen_1_7[((heartrate & 0xf00) >> 8)]>>8)); // LCD -> Digit 5 High Byte + LCDMEM[10] = ((char)(char_gen_1_7[((heartrate & 0xf00) >> 8)]&0x00FF)); // LCD -> Digit 5 Low Byte + //*/ + + } + } + } +}//main + +// Initialization function +void Init( void ) +{ + FLL_CTL0 |= XCAP10PF; // Set load capacitance for xtal + WDTCTL = WDTPW | WDTHOLD; // Disable the Watchdog + while ( LFOF & FLL_CTL0); // wait for watch crystal to stabilize + SCFQCTL = 63; // 32 x 32768 x 2 = 2.097152MHz + BTCTL = BT_fLCD_DIV128; // Set LCD frame freq = ACLK/128 +// Initialize and enable LCD peripheral + ClearLCD(); // Clear LCD memory + LCDCTL = LCDSG0_3 + LCD4MUX + LCDON ; // 4mux LCD, segs0-23 enabled +// Initialize and enable GPIO ports + P1OUT = 0x00 + BIT3; // Clear P1OUT register, INA turned ON + P1DIR = 0x3f; // Unused pins as outputs, Comparator pins as inputs + P2OUT = 0x00; // Clear P2OUT register + P2DIR = 0xff; // Unused pins as outputs + P2DIR = ~(PB_2_0+PB_2_1); // P2.0 and P2.1 push buttons + P2IES = 0x00; // Interrupt edge low to high transition + P2IFG = 0x00; // Clear pending P2 interrupts + P2IE = PB_2_0 | PB_2_1; // Enable intterupts for push buttons + P3OUT = 0x00; // Clear P3OUT register + P3DIR = 0x0f; // Unused pins as outputs except P3.<4-7> -> For the new LCD's received at ~04.10.2012 this must be inputs!! + P4OUT = 0x00; // Clear P4OUT register + P4DIR = 0xff; // Unused pins as outputs + P5OUT = 0x00; // Clear P5OUT register + P5DIR = 0xff; // Unused pins as outputs + P5SEL = 0xfc; // Set Rxx and COM pins for LCD + P6OUT = 0x00; // Clear P6OUT register + P6SEL = 0xff; // P6 = Analog +// Initialize and enable UART + P2SEL|=BIT4; // P2.4 = TXD + UCTL0 |= SWRST; // UART SWRST = 1 + ME1 |= UTXE0; // Enable UART0 TXD + UCTL0 |= CHAR; // 8-bit char, SWRST=1 + UTCTL0 |= SSEL1; // UCLK = SMCLK + UBR00 = 18; // 115200 from 2.097152MHz + UBR10 = 0; + UMCTL0 = 0x2c; // Modulation = 0.2044 + UCTL0 &= ~SWRST; // UART SWRST = 0, enable UART + IFG1 &= ~UTXIFG0; +// Initialize and enable ADC12 + ADC12CTL0 = ADC12ON + SHT0_4 + REFON + REF2_5V; + // ADC12 ON, Reference = 2.5V for DAC0 + ADC12CTL1 = SHP + SHS_1 + CONSEQ_2; // Use sampling timer, TA1 trigger + ADC12MCTL0 = INCH_1 + SREF_1; // Vref, channel = 1 = OA0 Out + ADC12IE = BIT0; // Enable interrupt for ADC12 MEM0 + ADC12CTL0 |= ENC; // Enable conversions +// Initialize and enable Timer_A + TACTL = TASSEL0 + MC_1 + TACLR; // ACLK, Clear TAR, Up Mode + TACCTL1 = OUTMOD_2; // Set / Reset + TACCR0 = 63; // 512 samples per second + TACCR1 = 15; // +// Initialize and enable DAC12x + DAC12_0CTL = DAC12OPS + DAC12CALON + DAC12IR + DAC12AMP_2 + DAC12ENC;// DAC0 enable + DAC12_1CTL = DAC12CALON + DAC12IR + DAC12AMP_2 + DAC12ENC; // DAC1 enable + DAC12_1DAT = 0x099A; // Offset level = 1.5V for op amp bias +// Initialize and enable opamps + OA0CTL0 = OAP_1 + OAPM_1 + OAADC1; // OA0 enable power mode 1, OA0- = P6.0, 0A0+ = P6.2, OA0O = P6.1 + OA0CTL1 = OARRIP; // General purpose mode, no Rail-to-Rail inputs + OA1CTL0 = OAP_3 + OAPM_1 + OAADC1; // OA1 enable power mode 1, OA1- = P6.4, OA1+ = DAC1, OA1O = P6.3 + OA1CTL1 = OARRIP; // General purpose mode, no Rail-to-Rail inputs + OA2CTL0 = OAP_3 + OAPM_1 + OAADC1; // OA2 enable power mode 1, OA2+ = DAC1, OA2O = P6.5, Select inputs, power mode + OA2CTL1 = OAFC_1 + OARRIP; // Unit gain Mode, no Rail-to-Rail inputs + __enable_interrupt(); // Enable global Interrupts +} //init + +void ClearLCD(void) +{ + int i; // + for( i = 0; i < 20; i++){ // Clear LCDMEM + LCDMEM[i] = 0; // + } +}//clear LCD + +int itobcd(int i) // Convert hex word to BCD. +{ + int bcd = 0; // + char j = 0; // + + while (i > 9) // + { + bcd |= ((i % 10) << j); // + i /= 10; // + j += 4; + } // + return (bcd | (i << j)); // Return converted value +}// itobcd(i) + + +int filterlp(int sample) // Lowpass FIR filter for EKG +{ + static int buflp[32]; // Reserve 32 loactions for circular buffering + static int offsetlp = 0; + long z; + int i; + + buflp[offsetlp] = sample; + z = mul16(coeffslp[8], buflp[(offsetlp - 8) & 0x1F]); + + __no_operation(); + + for (i = 0; i < 8; i++){ + z += mul16(coeffslp[i], buflp[(offsetlp - i) & 0x1F] + buflp[(offsetlp - 16 + i) & 0x1F]); + } + + offsetlp = (offsetlp + 1) & 0x1F; + return z >> 15; // Return filter output +}// int filter + +int filterhp(int samplehp) // Highpass FIR filter for hear rate +{ + static int bufhp[32]; // Reserve 32 loactions for circular buffering + static int offsethp = 0; + long z; + int i; + + bufhp[offsethp] = samplehp; + z = mul16(coeffshp[8], bufhp[(offsethp - 8) & 0x1F]); + + for (i = 0; i < 8; i++){ + z += mul16(coeffshp[i], bufhp[(offsethp - i) & 0x1F] + bufhp[(offsethp - 16 + i) & 0x1F]); + } + + offsethp = (offsethp + 1) & 0x1F; + return z >> 15; // Return filter output +}// int filterhp + +#pragma vector = PORT2_VECTOR +__interrupt void Port2ISR (void) +{ + P2IFG = 0; +}//Push buttons unused + +#pragma vector = ADC_VECTOR // ADC12 ISR +__interrupt void ADC12ISR (void) +{ + Datain = ADC12MEM0; // Store converted value in Datain + __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 on return +}// ADC12ISR + + diff --git a/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.dep b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.dep new file mode 100644 index 0000000..7466b10 --- /dev/null +++ b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.dep @@ -0,0 +1,128 @@ + + + + 2 + 475830264 + + Debug + + $PROJ_DIR$\MOD-EKG_DemoSoft.c + $TOOLKIT_DIR$\inc\msp430xg43x.h + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.d43 + $PROJ_DIR$\Debug\Obj\MOD-EKG_DemoSoft.pbd + $PROJ_DIR$\mul.s43 + $TOOLKIT_DIR$\inc\intrinsics.h + $PROJ_DIR$\Debug\Obj\MOD-EKG_DemoSoft.pbi + $TOOLKIT_DIR$\lib\dlib\dl430fn.h + $PROJ_DIR$\Debug\Obj\MOD-EKG_DemoSoft.r43 + $TOOLKIT_DIR$\lib\dlib\dl430fn.r43 + $TOOLKIT_DIR$\inc\in430.h + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.ulp + $PROJ_DIR$\Debug\Obj\mul.r43 + $TOOLKIT_DIR$\inc\dlib\c\ymath.h + $TOOLKIT_DIR$\inc\dlib\c\math.h + $TOOLKIT_DIR$\inc\dlib\c\ycheck.h + $TOOLKIT_DIR$\inc\dlib\c\DLib_Defaults.h + $TOOLKIT_DIR$\inc\dlib\c\xencoding_limits.h + $TOOLKIT_DIR$\inc\dlib\c\yvals.h + $TOOLKIT_DIR$\inc\dlib\c\DLib_Threads.h + $TOOLKIT_DIR$\inc\dlib\c\DLib_Product.h + $TOOLKIT_DIR$\inc\dlib\c\xtgmath.h + $TOOLKIT_DIR$\config\linker\lnk430fg439.xcl + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.a43 + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.hex + $PROJ_DIR$\Debug\Exe\ekg.hex + + + $PROJ_DIR$\MOD-EKG_DemoSoft.c + + + BICOMP + 6 + + + ICC430 + 8 + + + + + BICOMP + 1 10 5 14 15 13 18 16 7 20 17 19 21 + + + ICC430 + 1 10 5 14 15 13 18 16 7 20 17 19 21 + + + + + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.d43 + + + XLINK + 22 8 12 9 + + + + + $PROJ_DIR$\mul.s43 + + + A430 + 12 + + + + + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.a43 + + + XLINK + 22 8 12 9 + + + + + $PROJ_DIR$\Debug\Exe\MOD-EKG_DemoSoft.hex + + + XLINK + 22 8 12 9 + + + + + [ROOT_NODE] + + + XLINK + 25 + + + ULP430 + 11 + + + + + $PROJ_DIR$\Debug\Exe\ekg.hex + + + XLINK + 22 8 12 9 + + + + + + Release + + + [MULTI_TOOL] + XLINK + + + + + diff --git a/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewd b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewd new file mode 100644 index 0000000..8e50d56 --- /dev/null +++ b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewd @@ -0,0 +1,819 @@ + + + + 2 + + Debug + + MSP430 + + 1 + + C-SPY + 4 + + 27 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 430FET + 1 + + 27 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIM430 + 1 + + 4 + 1 + 1 + + + + + + + + + + + $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin + 1 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Release + + MSP430 + + 0 + + C-SPY + 4 + + 27 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 430FET + 1 + + 27 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIM430 + 1 + + 4 + 1 + 0 + + + + + + + + + + + $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin + 1 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewp b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewp new file mode 100644 index 0000000..774bc6b --- /dev/null +++ b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.ewp @@ -0,0 +1,2161 @@ + + + + 2 + + Debug + + MSP430 + + 1 + + General + 14 + + 32 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICC430 + 4 + + 37 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A430 + 5 + + 14 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + XLINK + 4 + + 27 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XAR + 4 + + 0 + 1 + 1 + + + + + + + ULP430 + 1 + + 1 + 1 + 1 + + + + + + + + + BILINK + 0 + + + + + Release + + MSP430 + + 0 + + General + 14 + + 32 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICC430 + 4 + + 37 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A430 + 5 + + 14 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + XLINK + 4 + + 27 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XAR + 4 + + 0 + 1 + 0 + + + + + + + ULP430 + 1 + + 1 + 1 + 0 + + + + + + + + + BILINK + 0 + + + + + $PROJ_DIR$\MOD-EKG_DemoSoft.c + + + $PROJ_DIR$\mul.s43 + + + + diff --git a/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.eww b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.eww new file mode 100644 index 0000000..a488007 --- /dev/null +++ b/mod_ekg_psychose/iar/MOD-EKG_DemoSoft.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\MOD-EKG_DemoSoft.ewp + + + + + diff --git a/mod_ekg_psychose/iar/mul.s43 b/mod_ekg_psychose/iar/mul.s43 new file mode 100644 index 0000000..38de4bf --- /dev/null +++ b/mod_ekg_psychose/iar/mul.s43 @@ -0,0 +1,110 @@ +// +//16x16=>32 multiply +//long mul16(register int x, register int y) +// +// Edited by: M Morales, November 2008 +// * Updated calling conventions in support of IAR compiler >= 4.x +//***************************************************************************** +// THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR +// REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, +// INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR +// COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. +// TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET +// POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY +// INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR +// YOUR USE OF THE PROGRAM. +// +// IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +// CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY +// THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED +// OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT +// OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. +// EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF +// REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS +// OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF +// USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S +// AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF +// YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS +// (U.S.$500). +// +// Unless otherwise stated, the Program written and copyrighted +// by Texas Instruments is distributed as "freeware". You may, +// only under TI's copyright in the Program, use and modify the +// Program without any charge or restriction. You may +// distribute to third parties, provided that you transfer a +// copy of this license to the third party and the third party +// agrees to these terms by its first use of the Program. You +// must reproduce the copyright notice and any other legend of +// ownership on each copy or partial copy, of the Program. +// +// You acknowledge and agree that the Program contains +// copyrighted material, trade secrets and other TI proprietary +// information and is protected by copyright laws, +// international copyright treaties, and trade secret laws, as +// well as other intellectual property laws. To protect TI's +// rights in the Program, you agree not to decompile, reverse +// engineer, disassemble or otherwise translate any object code +// versions of the Program to a human-readable form. You agree +// that in no event will you alter, remove or destroy any +// copyright notice included in the Program. TI reserves all +// rights not specifically granted under this license. Except +// as specifically provided herein, nothing in this agreement +// shall be construed as conferring by implication, estoppel, +// or otherwise, upon you, any license or other right under any +// TI patents, copyrights or trade secrets. +// +// You may not use the Program in non-TI devices. +//***************************************************************************** + public mul16 + + RSEG CODE +mul16 + +#define x1 r9 +#define z0 r14 +#define z1 r15 +#define x r12 +#define y r13 + + push r9 + + clr z0 + mov z0,z1 + mov z0,x1 + tst x + jge xbooth_2 + mov #-1,x1 + jmp xbooth_2 + +xbooth_6 + add x,z1 + addc x1,z0 +xbooth_1 + rla x + rlc x1 +xbooth_2 + rra y + jc xbooth_5 + jne xbooth_1 + jmp xbooth_4 + +xbooth_5 + sub x,z1 + subc x1,z0 +xbooth_3 + rla x + rlc x1 + rra y + jnc xbooth_6 + cmp #0FFFFh,y + jne xbooth_3 + +xbooth_4 + mov z1,r12 + mov z0,r13 + + pop r9 + + ret + end diff --git a/mod_ekg_psychose/iar/path.txt b/mod_ekg_psychose/iar/path.txt new file mode 100644 index 0000000..e69de29 diff --git a/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.Debug.cspy.bat b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.Debug.cspy.bat new file mode 100644 index 0000000..bdbe693 --- /dev/null +++ b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.Debug.cspy.bat @@ -0,0 +1,24 @@ +@REM This batch file has been generated by the IAR Embedded Workbench +@REM C-SPY Debugger, as an aid to preparing a command line for running +@REM the cspybat command line utility using the appropriate settings. +@REM +@REM Note that this file is generated every time a new debug session +@REM is initialized, so you may want to move or rename the file before +@REM making changes. +@REM +@REM You can launch cspybat by typing the name of this batch file followed +@REM by the name of the debug file (usually an ELF/DWARF or UBROF file). +@REM +@REM Read about available command line parameters in the C-SPY Debugging +@REM Guide. Hints about additional command line parameters that may be +@REM useful in specific cases: +@REM --download_only Downloads a code image without starting a debug +@REM session afterwards. +@REM --silent Omits the sign-on message. +@REM --timeout Limits the maximum allowed execution time. +@REM + + +"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0_2\common\bin\cspybat" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0_2\430\bin\430proc.dll" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0_2\430\bin\430fet.dll" %1 --plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0_2\430\bin\430bat.dll" --backend -B "-p" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0_2\430\config\debugger\MSP430FG439.ddf" "--iv_base" "0xFFE0" "-d" "fet" "--erase_main_and_info" "--derivative" "MSP430FG43x_F43x" "--protocol" "4wire" "--eem" "EMEX_LOW" "--port" "Automatic" "--connection" "olimex" "--settlingtime=0" "--msp430_dll" "msp430.dll" "--vccDefault" "3.3" "--jtag_speed" "medium" "--memtype" "F" + + diff --git a/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.cspy.bat b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.cspy.bat new file mode 100644 index 0000000..e68ae66 --- /dev/null +++ b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.cspy.bat @@ -0,0 +1,34 @@ +@REM This bat file has been generated by the IAR Embeddded Workbench +@REM C-SPY interactive debugger,as an aid to preparing a command +@REM line for running the cspybat command line utility with the +@REM appropriate settings. +@REM +@REM After making some adjustments to this file, you can launch cspybat +@REM by typing the name of this file followed by the name of the debug +@REM file (usually an ubrof file). Note that this file is generated +@REM every time a new debug session is initialized, so you may want to +@REM move or rename the file before making changes. +@REM +@REM Note: some command line arguments cannot be properly generated +@REM by this process. Specifically, the plugin which is responsible +@REM for the Terminal I/O window (and other C runtime functionality) +@REM comes in a special version for cspybat, and the name of that +@REM plugin dll is not known when generating this file. It resides in +@REM the $TOOLKIT_DIR$\bin folder and is usually called XXXbat.dll or +@REM XXXlibsupportbat.dll, where XXX is the name of the corresponding +@REM tool chain. Replace the '' parameter +@REM below with the appropriate file name. Other plugins loaded by +@REM C-SPY are usually not needed by, or will not work in, cspybat +@REM but they are listed at the end of this file for reference. + + +"C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\common\bin\cspybat" "C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\430\bin\430proc.dll" "C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\430\bin\430fet.dll" %1 --plugin "C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\430\bin\" --backend -B "-p" "C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\430\config\MSP430FG439.ddf" "--iv_base" "0xFFE0" "-d" "fet" "--erase_main_and_info" "--derivative" "MSP430FG439" "--vccvoltage=3.3" "--protocol" "4wire" "--eem" "EMEX_LOW" "--connection" "olimex" "--settlingtime=0" + + +@REM Loaded plugins: +@REM C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\430\bin\430libsupport.dll +@REM C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\430\plugins\lcd\lcd.dll +@REM C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\common\plugins\CodeCoverage\CodeCoverage.dll +@REM C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\common\plugins\Profiling\Profiling.dll +@REM C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\common\plugins\stack\stack.dll +@REM C:\Program Files\IAR Systems\IAR Embedded Workbench for MSP, v4.21 Evaluation version\common\plugins\SymList\SymList.dll diff --git a/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dbgdt b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dbgdt new file mode 100644 index 0000000..ad1fd54 --- /dev/null +++ b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dbgdt @@ -0,0 +1,89 @@ + + + + + + + + + 201221 + + + + + + 2091524461 + + + + + + + 174272727 + + + + + + 100Disassembly_I05002011 + + + + + + + + + TabID-32631-32423 + Debug Log + Debug-Log + + + + TabID-32108-32433 + Build + Build + + + + + 0 + + + TabID-10611-32426 + Workspace + Workspace + + + MOD-EKG_DemoSoft + + + + 0 + + + TabID-21360-32430 + Disassembly + Disassembly + + + + + 0 + + + + + + TextEditor$WS_DIR$\MOD-EKG_DemoSoft.c00000249115951159500100000010000001 + + + + + + + iaridepm.enu1debuggergui.enu1430fet1-2-2562248-2-2250175156250211353156250681159-2-2562248-2-2250175156250211353156250681159-2-21731602-2-216041751002500211353156250211353 + + + + diff --git a/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dni b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dni new file mode 100644 index 0000000..82319a6 --- /dev/null +++ b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.dni @@ -0,0 +1,94 @@ +[Interrupts] +Enabled=1 +[MemoryMap] +Enabled=0 +Base=0 +UseAuto=0 +TypeViolation=1 +UnspecRange=1 +ActionState=1 +[TraceHelper] +Enabled=0 +ShowSource=1 +[DebugChecksum] +Checksum=-1742591943 +[State Storage] +Control Register=5814 +[Sequencer] +Control Register=0 +NextState0=0 +NextState1=0 +[Action Register] +Break=0 +State Storage=0 +[DisAssemblyWindow] +NumStates=_ 1 +State 1=_ 1 +[InstructionProfiling] +Enabled=_ 0 +[CodeCoverage] +Enabled=_ 0 +[Profiling] +Enabled=0 +[StackPlugin] +Enabled=1 +OverflowWarningsEnabled=1 +WarningThreshold=90 +SpWarningsEnabled=1 +WarnHow=0 +UseTrigger=1 +TriggerName=main +LimitSize=0 +ByteLimit=50 +[Stack] +FillEnabled=0 +OverflowWarningsEnabled=1 +WarningThreshold=90 +SpWarningsEnabled=1 +WarnLogOnly=1 +UseTrigger=1 +TriggerName=main +LimitSize=0 +ByteLimit=50 +[EEM State Storage] +Buffer=BAAAAAAADAAAAAAAAAAAAAAA +[EEM Sequencer] +Buffer=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +[NumberOfSequencerBp] +Number=4 +[Breakpoints] +Count=0 +[FET] +Clock mode=46 +Extended Clock mode=65535 +Secure Password= +Extended Clock Control Enable=1 +Advanced Extended Clock Control=0 +Emulation mode=0 +Free running=0 +Shutting Down=3 +[Memory Dump] +Start address= +Lenghth= +Address info=0 +Format=0 +Dump registers=0 +PC=0 +SP=0 +SR=0 +all registers=0 +File name= +[Log file] +LoggingEnabled=_ 0 +LogFile=_ "" +Category=_ 0 +[TermIOLog] +LoggingEnabled=_ 0 +LogFile=_ "" +[Aliases] +Count=0 +SuppressDialog=0 +[CallStack] +ShowArgs=0 +[Disassembly] +MixedMode=1 diff --git a/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wsdt b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wsdt new file mode 100644 index 0000000..5dc5a36 --- /dev/null +++ b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wsdt @@ -0,0 +1,77 @@ + + + + + + MOD-EKG_DemoSoft/Debug + + + + + + + + + 318272727 + + + + + + + 2091524461 + + + + 201221 + + 44062754 + + + + + + + TabID-5007-30075 + Workspace + Workspace + + + MOD-EKG_DemoSoftMOD-EKG_DemoSoft/OutputMOD-EKG_DemoSoft/Output/MOD-EKG_DemoSoft.d43 + + + + 0 + + + TabID-616-32204 + Build + Build + + + + TabID-32338-32224 + Debug Log + Debug-Log + + + TabID-552-6144Find in FilesFind-in-Files + + 0 + + + + + + TextEditor$WS_DIR$\MOD-EKG_DemoSoft.c00000199119051190500100000010000001 + + + + + + + iaridepm.enu1-2-2630392-2-2250175156250211353246250763285-2-21531602-2-216041551002500187198156250211353 + + + + diff --git a/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wspos b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wspos new file mode 100644 index 0000000..2c8cfad --- /dev/null +++ b/mod_ekg_psychose/iar/settings/MOD-EKG_DemoSoft.wspos @@ -0,0 +1,2 @@ +[MainWindow] +WindowPlacement=_ 25 25 1225 657 3