2개는 정상인데 나머지 8개는 전원넣어도 무반응....
Flash Tool 로 이미지 구워볼랬더니 아래와 같은 메세지 나옵니다.
* Accessing device...
# Exit: 16
# ERROR: The Debug Interface to the device has been secured
참고하셔요....
정상 2개는 이런저런 활용도 가능하겠어요..
#include <msp430.h>
/**
* main.c
*/
#define a 0x01
#define b 0x02
#define c 0x04
#define h 0x80
#define f 0x10
#define g 0x40
#define e 0x20
#define d 0x08
const char distab[] = { // definitions for digits
a+b+c+d+e+f, // Displays "0"
b+c, // Displays "1"
a+b+d+e+g, // Displays "2"
a+b+c+d+g, // Displays "3"
b+c+f+g, // Displays "4"
a+c+d+f+g, // Displays "5"
a+c+d+e+f+g, // Displays "6"
a+b+c, // Displays "7"
a+b+c+d+e+f+g, // Displays "8"
a+b+c+d+f+g // Displays "9"
};
void delay(int x) // 5*x+12 nop
{ //128- 23 256-49
while(x--);
} //192- 36 280- 54 448- 87
volatile unsigned int j = 0; // Volatile to prevent optimization. This keeps count of cycles between LED toggles
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
FLL_CTL0 |= XCAP14PF; // Configure load caps
P1DIR |= 0x0D; // Set P1.0 to output direction
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = 32768-1;
TACTL = TASSEL_1 + MC_1; // ACLK, up mode
FLL_CTL0 |= XCAP14PF; // Set load cap for 32k xtal
LCDACTL = LCDON + LCD4MUX + LCDFREQ_128; // 4mux LCD, ACLK/128
LCDAPCTL0 = 0x07; // Segments 0-13
P5SEL = 0x1C; // Set COM pins for LCD
P6DIR |= 11000000; // P1DIR is a register that configures the direction (DIR) of a port pin as an output or an input.
LCDMEM[4] &= ~0xFF;
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt
}
// Timer A0 interrupt service routine
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
float results = 0 ;
float ondo = 0.0f;
int ondo_1 = 0;
SD16CTL = SD16REFON + SD16SSEL0; // 1.2V ref, SMCLK
SD16CCTL0 |= SD16SNGL; // Single conv
SD16INCTL0 = SD16INCH_6;
delay(100);
SD16CCTL0 |= SD16SC; // Set bit to start conversion
while ((SD16CCTL0 & SD16IFG)==0); // Poll interrupt flag
results = SD16MEM0; // Save CH0 results (clears IFG)
ondo = (results * 909)/65536 - 727;
ondo_1 = ondo * 10;
_NOP(); // SET BREAKPOINT HERE
P6OUT ^= 0x80; // Toggle P1.0 using exclusive-OR operation (^=)
P6OUT ^= 0x40; // P1OUT is another register which holds the status of the LED.
if (ondo_1 < 350) {P1OUT &= ~0x08; P1OUT ^= 0x04; } // Toggle P1.0 using exclusive-OR operation (^=)
if (ondo_1 >= 350) {P1OUT &= ~0x04; P1OUT ^= 0x08;} // Toggle P1.0 using exclusive-OR operation (^=)
char i;
for(i=0;i<4;i++)
{
LCDMEM[3-i] = distab[ondo_1 % 10 ];
ondo_1 = ondo_1 / 10 ;
}
LCDMEM[4] = 0x0A;
}