게임/마비노기2013. 12. 26. 11:05
불쌍한 나과장 ㅠㅠ
그런다고 돌아가진 않아 흥!


 
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 25. 00:41


사용부품
[링크 : http://www.us-technology.co.kr/product/product_main.asp?mode=101&smode=9] v3.0 보드
[링크 : http://devicemart.co.kr/goods/view.php?seq=1075057 ] LC1628 (동일 부품 아닐수도 있음)

참고소스
[링크 : http://www.avrprojects.net/attachments/lcdinterface.c]

참고 데이터시트
[링크 : http://www.ganasys.co.kr/kor/support_board2/pds_file/LC1628-BMDWH6Rev1.0.pdf]



lc1628.h
/*******************************************************
	LC1628 definition
*******************************************************/

/***************** position *****************/
#define	CLCD_RS	0x01
#define	CLCD_RW	0x02
#define	CLCD_E	0x04
#define	CLCD_DA	0xF0

/***************** command *****************/
/* RS R/W = 0x00 */
#define CMD_CLS 0x01	// Clear Display
#define CMD_RTH 0x02	// Return HOME
#define CMD_MOD 0x04	// Entry Mode Set
	#define MOD_INC 0x02
	#define MOD_DEC 0x00
	#define MOD_SHL 0x01
	#define MOD_SHR 0x00
#define CMD_DIS 0x08	// Display on/off
	#define DIS_ON  0x04
	#define DIS_CUR 0x02
	#define DIS_BLK	0x01
#define CMD_CUR 0x10	// Cursor or Display Shift
	#define CUR_CUR 0x08
	#define CUR_ALL	0x00
	#define CUR_LEF 0x04
	#define CUR_RIG 0x00
#define CMD_FNC 0x20	// Function Set
	#define FNC_DL8 0x10
	#define FNC_DL4 0x00
	#define FNC_DN2 0x08
	#define FNC_DN1 0x00
	#define FNC_H10	0x04
	#define FNC_H07	0x00
#define CMD_CGA 0x40	// Set CGRAM Address
	#define CRA_ADR 0x3F
#define CMD_DDA 0x80	// Set DDRAM Address

lc1628.c
#include < stdio.h >
#include < avr/io.h >
#include < util/delay.h >
#include "lc1628.h"

#define DEFAULT_DLY	20

static int uart_putchar(char c, FILE *stream)
{
	if (c == '\n') uart_putchar('\r', stream);
	loop_until_bit_is_set(UCSR0A, UDRE);
	UDR0 = c;

  return 0;
}

static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);


/*************************************************/
void ls1628_write_cmd(char cmd)
{
	/**************************************/
	// set RS & R/W
	PORTC = 0x00;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - high nibble
	PORTC |= (cmd & 0xF0);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);


	/**************************************/
	// set RS & R/W
	PORTC = 0x00;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - low nibble
	PORTC |= ((cmd & 0x0F) << 4);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);
}

void ls1628_write_char(char data)
{
	/**************************************/
	// set RS & R/W
	PORTC = CLCD_RS;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - high nibble
	PORTC |= (data & 0xF0);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);


	/**************************************/
	// set RS & R/W
	PORTC = CLCD_RS;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - low nibble
	PORTC |= ((data & 0x0F) << 4);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);
}

/*************************************************/
void ls1628_cmd_clear()
{
	ls1628_write_cmd(CMD_CLS);
}

void li1628_cmd_setpos(char y, char x)
{
	// y must 0(1st line) or 1(2nd line)
	ls1628_write_cmd(CMD_DDA | (y * 0x40 + x));
}

void ls1628_write_string(char *data)
{
	int idx = 0;

	while(data[idx] != 0x00)
		ls1628_write_char(data[idx++]);
}

/*************************************************/
void init_clcd(void)
{
	_delay_ms(50);
	ls1628_write_cmd(CMD_FNC | FNC_DL4 | FNC_DN2 | FNC_H07);	// fuction set
	PORTC = CLCD_E; // unknown

	_delay_us(80);	 											// 39 us wait
	ls1628_write_cmd(CMD_DIS | DIS_ON | DIS_CUR | DIS_BLK);		// disp on/off control
	_delay_us(80);	 											// 39 us wait
	ls1628_write_cmd(CMD_CLS);									// disp clear
	_delay_ms(2);												// 1.53ms wait
	ls1628_write_cmd(CMD_MOD | MOD_INC | MOD_SHR);				// entry mode set CMD_MOD
	_delay_us(80);
	ls1628_write_cmd(CMD_DDA);
	_delay_us(80);
}

void init_uart0(void)
{
	/* UART0 115200-N-8-1 */
	UBRR0H = 0;
	UBRR0L = 8; // 115k with U2X = 0
	UCSR0A = 0x00; // U2X = 0;
	UCSR0B = 0xD8;
	UCSR0C = 0x06; //Asyncronous - no parity - 1bits(stop) - 8bits(data)

    stdout = &mystdout;

	printf("\n\n\n\n\n");
}

void init_atmega(void)
{
	DDRC = 0xFF;
	PORTC = 0xFF;

	SFIOR = SFIOR | 0x04;

	init_uart0();
}

int main(void)
{
	init_atmega();
	init_clcd();

	li1628_cmd_setpos(0,3);
	ls1628_write_string("Hello World");
	li1628_cmd_setpos(1,0);
	ls1628_write_string("ATmega128 CLCD");

	return 0;
}

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ATmega8 로 ES-311(HS-311) 서보 제어하기  (2) 2013.12.29
ATtiny2313 / ATmega8 인공호흡!  (0) 2013.12.27
ATmega128 + LC1628 제어하기 2  (0) 2013.12.24
ATmega128 + LC1628 제어하기 1  (0) 2013.12.24
lc1628 예제 소스  (0) 2013.12.20
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 24. 23:54
명령어와 데이터 관련 GPIO 제어루틴

귀찮으니 대충 정리해서
명령어는
Step 1. RS/RW가 동시에 Low로 이동 (40ns delay)
Step 2. E가 High로 이동 / Data 설정(상위 4비트)
Step 3. E가 Low로 이동 (10ns delay)
Step 4. RW 해제
 

Step 5. RS/RW가 동시에 Low로 이동
Step 6. E가 High로 이동 / Data 설정 (하위 4비트) - Step 2 반복
Step 7. E가 Low로 이동 (10ns delay) - Step 3 반복
Step 8. RS/RW가 동시에 High로 이동

DDRAM/CGRAM 데이터는
Step 1. RS는 High RW는 Low로 이동 (40ns delay)
Step 2. E가 High로 이동 / Data 설정(상위 4비트)
Step 3. E가 Low로 이동 (10ns delay)
Step 4. RW 해제
 

Step 5. RS는 High RW는 Low로 이동
Step 6. E가 High로 이동 / Data 설정 (하위 4비트) - Step 2 반복
Step 7. E가 Low로 이동 (10ns delay) - Step 3 반복
Step 8. RS/RW가 동시에 High로 이동


#define	CLCD_RS	0x01
#define	CLCD_RW	0x02
#define	CLCD_E	0x04

#define DEFAULT_DLY	20

void ls1628_write_cmd(char cmd)
{
	/**************************************/
	// set RS & R/W
	PORTC = 0x00;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - high nibble
	PORTC |= (cmd & 0xF0);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);


	/**************************************/
	// set RS & R/W
	PORTC = 0x00;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - low nibble
	PORTC |= ((cmd & 0x0F) << 4);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);
}

void ls1628_write_char(char data)
{
	/**************************************/
	// set RS & R/W
	PORTC = CLCD_RS;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - high nibble
	PORTC |= (data & 0xF0);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);


	/**************************************/
	// set RS & R/W
	PORTC = CLCD_RS;

	// set E clock to high
	_delay_us(DEFAULT_DLY); // 40ns delay
	PORTC |= CLCD_E;

	// data set - low nibble
	PORTC |= ((data & 0x0F) << 4);
	_delay_us(DEFAULT_DLY); // 80ns delay

	// set E clock to low
	PORTC &= (~CLCD_E);
	_delay_us(DEFAULT_DLY); // 10ns delay

	// release RW
	PORTC &= (~CLCD_RW);
}

CLCD 초기화는 아래와 같이 수행해 준다.
그런데.. Function set 이후에 왜 E를 High로 해주어야 하는건지... 이유를 모르겠다!!!
#define CMD_CLS 0x01	// Clear Display
#define CMD_RTH 0x02	// Return HOME
#define CMD_MOD 0x04	// Entry Mode Set
	#define MOD_INC 0x02
	#define MOD_DEC 0x00
	#define MOD_SHL 0x01
	#define MOD_SHR 0x00
#define CMD_DIS 0x08	// Display on/off
	#define DIS_ON  0x04
	#define DIS_CUR 0x02
	#define DIS_BLK	0x01
#define CMD_CUR 0x10	// Cursor or Display Shift
	#define CUR_CUR 0x08
	#define CUR_ALL	0x00
	#define CUR_LEF 0x04
	#define CUR_RIG 0x00
#define CMD_FNC 0x20	// Function Set
	#define FNC_DL8 0x10
	#define FNC_DL4 0x00
	#define FNC_DN2 0x08
	#define FNC_DN1 0x00
	#define FNC_H10	0x04
	#define FNC_H07	0x00
#define CMD_CGA 0x40	// Set CGRAM Address
	#define CRA_ADR 0x3F
#define CMD_DDA 0x80	// Set DDRAM Address

void init_clcd(void)
{
	_delay_ms(50);
	ls1628_write_cmd(CMD_FNC | FNC_DL4 | FNC_DN2 | FNC_H07);	// fuction set
	PORTC = CLCD_E; // unknown

	_delay_us(80);	 											// 39 us wait
	ls1628_write_cmd(CMD_DIS | DIS_ON | DIS_CUR | DIS_BLK);		// disp on/off control
	_delay_us(80);	 											// 39 us wait
	ls1628_write_cmd(CMD_CLS);									// disp clear
	_delay_ms(2);												// 1.53ms wait
	ls1628_write_cmd(CMD_MOD | MOD_INC | MOD_SHR);				// entry mode set CMD_MOD
	_delay_us(80);
	ls1628_write_cmd(CMD_DDA);
	_delay_us(80);
}

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ATtiny2313 / ATmega8 인공호흡!  (0) 2013.12.27
ATmega128 + LC1628 제어하기 3  (2) 2013.12.25
ATmega128 + LC1628 제어하기 1  (0) 2013.12.24
lc1628 예제 소스  (0) 2013.12.20
Atmega8 으앙 쥬금!!! ㅠㅠ  (0) 2013.12.20
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 24. 23:46
현재는 DDRAM에 문자만 넣는 정도로 간략하게 출력하는 예제이다.

PORTC 에
7654(DATA) 2(E) 1(RW) 0(RS) 로 회로가 구성된 경우의 소스이다.

일단 LC1628의 타이밍 차트는 아래와 같으며
RS/RW 가 동시에 움직이고
E의 falling edge에서 Data를 읽어 가도록 되어있다.



8bit도 해봐야 하는데.. 회로 구성이 일단 4bit로 되어있으니
4비트 강제 설정을 해주어야 하는데
문서의 실수인지 Function Set이 12 비트이다..
그냥 무시하고 8바이트로 보내도 문제는 없는 것 같긴하다.


기본 설정시의 DDRAM 주소이다.
0x40을 더해주면 2번째 라인으로 이동된다.


'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ATmega128 + LC1628 제어하기 3  (2) 2013.12.25
ATmega128 + LC1628 제어하기 2  (0) 2013.12.24
lc1628 예제 소스  (0) 2013.12.20
Atmega8 으앙 쥬금!!! ㅠㅠ  (0) 2013.12.20
avr pud(pull up disable)  (0) 2013.12.19
Posted by 구차니
개소리 왈왈/자전거2013. 12. 23. 11:03
일단 200km 가신다는 분이 있어서 꼽사리 껴 갈까 고민중
동부 코스는 분원리 지나 강원도를 돌아 오는 코스이고
서부 코스는 아라뱃길 따라 강원도 돌아 오는 코스인데
둘다 업힐이 존재 하지만 상대적으로 서부 코스가 무난한듯


그나저나... 4:30부터 8:00 까지 새벽(!) 출발인데 끄앙.. ㅠㅠ


 

 


[링크 : 
http://www.korea-randonneurs.org/menu1c.htm]

'개소리 왈왈 > 자전거' 카테고리의 다른 글

오늘의 지름 - 휴대용 토크렌찌  (0) 2014.02.28
간만에 자전거..  (0) 2014.01.11
바이크 쇼 2013  (6) 2013.11.29
금강 종주 완료  (0) 2013.11.23
속도계 분실 -_-  (0) 2013.11.21
Posted by 구차니
개소리 왈왈/컴퓨터2013. 12. 22. 22:09
후... 새드 ㅠㅠ

OS 하드가 미쳐가는중.. vhd 파일 백업하고 다른데서 쓸수 있으면 좋으련만 ㅠㅠ

 
+
IDE 하드인데.. 전원 커넥터가 헐거워 조이고 나서 다시 꼽아주니 아직까진 큰 문제 없이 작동한다..
-_- 머지?!?!?!? 
Posted by 구차니
끄아아아 앙대 ㅠㅠ
난 백수라고!! ㅠㅠ


Posted by 구차니
Linux2013. 12. 20. 23:33
아는 지인의 요청으로 검색하게 된 내용


crontab의 경우 시스템 전체와 사용자 별로 설정을 저장한다.
crontab [-u user] file
crontab [-u user] [-l | -r | -e] [-i] [-s]
 
[링크 : http://linux.die.net/man/1/crontab ] 

ubuntu 12.10 LTS에서 도움말을 보니 추가된 내용이 있는데
$ man crontab
FILES
       /etc/cron.allow
       /etc/cron.deny
       /var/spool/cron/crontabs

       There  is  one  file  for  each  user's  crontab under the /var/spool/cron/crontabs directory. Users are not
       allowed to edit the files under that directory directly to ensure that only users allowed by the  system  to
       run  periodic  tasks  can  add them, and only syntactically correct crontabs will be written there.  This is
       enforced by having the directory writable only by the crontab group and configuring crontab command with the
       setgid bid set for that specific group. 

/etc/crontab 은 system 전체에 대한 (데몬용) crontab이고
/var/spool/cron/crontabs/ 에는 사용자별 crontab 파일이 존재한다.

또한 cron에 대한 로그는
기본적으로
/var/log/syslog에서 "CRON" 키워드로 검색을 하면 나오지만 안나온다면
cron에서 실행되는 스크립트의 마지막에 로그를 남기도록 하는 수 밖에 없을듯 하다. 
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 20. 15:48
원래 링크의 카페는 막혀있어서
회로 구성이라던가 이런걸 알 수 없지만 참고용으로 링크 저장

데이터시트 상으로는 ns 급으로 쉬어주어야 하지만
AVR ATmega128 16MHz라고 해도
명령어 처리에 10ns 급 정도의 딜레이는 가볍게 생기니까
그런건 무시하고 바로바로 포트에 값을 넣어 주는 듯 하다.

[링크 : http://blog.daum.net/irobotavr/668278] 8bit 통신

4bit 통신예제. PORTB로 되어있음. 하지만.. 작동이 안되네?
// used pins on port B
#define LCD_DB4 0    // PORTB.0 
#define LCD_DB5 1    // PORTB.1
#define LCD_DB6 2    // PORTB.2 
#define LCD_DB7 3    // PORTB.3
#define LCD_E  6     // PORTB.6 Enable 
#define LCD_RS 7     // PORTB.7 Register Select
[링크 : http://www.avrprojects.net/.../avr-c-programming-tutorials/112-4-bit-lcd-interface] 4bit 통신


---
PORTC 에 
7654(DATA) 2(E) 1(RW) 0(RS) 로 회로가 구성된 경우로 포팅한 녀석.
이 소스는 문자가 무언가는 나오지만 제대로 나오지 않는 문제가 있다.
하지만 이 소스를 통해 CLCD를 초기화할 경우 제대로 되기에 초기화 부분을 분석해서 내 소스에 적용하게 됨.
// used pins on port B
#define LCD_DB4 4    // PORTB.0 
#define LCD_DB5 5    // PORTB.1
#define LCD_DB6 6    // PORTB.2 
#define LCD_DB7 7    // PORTB.3
#define LCD_E  2     // PORTB.6 Enable 
#define LCD_RS 0     // PORTB.7 Register Select


//LCD commands
#define LCD_CLR 		0x01    // clear display
#define LCD_HOME 		0x02    // return home

#define LCD_INC 		0x06    // Increment, display freeze
#define LCD_MOV 		0x10    // Cursor move, not shift

#define LCD_OFF         0x08    // lcd off
#define LCD_ON          0x0C    // lcd on             
#define LCD_BLINK_ON	0x0D    // blink on              
#define LCD_CURSOR_ON	0x0E    // cursor on               
#define LCD_ALL_ON	    0x0F    // cursor on /  blink on
#define LCD_LINE1  		0x80    // cursor Pos on line 1 (or with column)
#define LCD_LINE2  		0xC0    // cursor Pos on line 2 (or with column)

unsigned char chr,data,pos;

// writes a char to the LCD
void LCD_char(unsigned char data)

{
	PORTC = data & 0b11110000; //high nibble
	PORTC |= 1 << LCD_RS;
	PORTC |= 1 << LCD_E;
	_delay_ms(2);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(2);

	PORTC = (data << 4) & 0b11110000; //low nibble
	PORTC |= 1 << LCD_RS;
	PORTC |= 1 << LCD_E;
	_delay_ms(2);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(2);
}


// writes a instruction to the LCD
void LCD_inst(unsigned char inst)

{	
	PORTC = (inst & 0b11110000); //send high nibble
	PORTC &= ~(1 << LCD_RS); // set RS to instructions
	PORTC |= 1 << LCD_E;
	_delay_ms(2);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(2);

	PORTC = (inst << 4) & 0b11110000; //send low nibble
	PORTC |= 1 << LCD_E;
	_delay_ms(2);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(2);	
}

// clear display
void LCDclr(void)
{
	LCD_inst (LCD_CLR);
}

// return home
void LCDhome(void)
{
	LCD_inst (LCD_HOME);
}

// LCD off
void LCDoff(void)
{
	LCD_inst (LCD_OFF);
}

// LCD on
void LCDon(void)
{
	LCD_inst (LCD_ON);
}

// cursor on
void LCDcursor(void)
{
	LCD_inst (LCD_CURSOR_ON);
}

// blink on
void LCDblink(void)
{
	LCD_inst (LCD_BLINK_ON);
}

// cursor all on
void LCDall(void)
{
	LCD_inst (LCD_ALL_ON);
}

//go to first line
void LCDline1 (void)

{
	LCD_inst (0b10000000);
}

//go to second line
void LCDline2 (void)
{
	LCD_inst (0b11000000);
}


// goto position x,y
void LCDgoto (char x,char y)
{

	if (y == 0)			pos = 0b00000000 + x;
	else if (y == 1)	pos = 0b01000000 + x;

	LCD_inst (0b10000000 | pos);
}

//write text to the LCD
void LCDtext(char *data)
{
	while (*data)
	{
		LCD_char(*data);
		data++;
	}
}

// init LCD

void LCD_init(void)
{
	DDRC = 0xFF;  // PORTC as output
	_delay_ms(40);

	// set 4-bit mode
	PORTC = 1 << 2;
	PORTC |= 1 << LCD_E;
	_delay_ms(1);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(1);

	PORTC = 1<< 2;
	PORTC |= 1 << LCD_E;
	_delay_ms(1);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(1);

	PORTC = 1 << 2;
	PORTC |= 1 << LCD_E;
	_delay_ms(1);
	PORTC &= ~(1 << LCD_E);
	_delay_ms(1);

	//set 4-bit mode and 2-line
	//LCD_inst (0b00101000);
	LCD_inst (0b00101000);

	//turn on display and cursor
	LCD_inst (0b00001100);

	//clr display
	LCD_inst (LCD_CLR);
}

int main( void )
{
	LCD_init();
	LCDtext (">AVR LCD DEMO<");
	LCDgoto (2,1);
	LCDtext("Hello World!");
	LCDall();
	LCDhome();
}

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ATmega128 + LC1628 제어하기 2  (0) 2013.12.24
ATmega128 + LC1628 제어하기 1  (0) 2013.12.24
Atmega8 으앙 쥬금!!! ㅠㅠ  (0) 2013.12.20
avr pud(pull up disable)  (0) 2013.12.19
AVR-GCC Program space  (0) 2013.12.19
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 20. 11:09
거상인의 Atmega8 보드의 기본값은 내부 RC 클럭 1MHz 이다.


그래서! 외부 16MHz 크리스탈로 바꾸려고 했는데!! 망했어요!!! ㅠㅠ
아무생각없이 외부 클럭이니까.. Ext. Clock 이면 될꺼야. 클릭.. 어.. 안읽히네?!?!?


그래서 부랴부랴
us-technology의 외부 16MHz 크리스탈 제품의 설정값을 읽어 보니 ㅠㅠ
"Ext. Crystal/Resonator"  ㅠㅠ

일단.. 현재 상태는.. External Clock이 된거 같은데.. 문제는 이상황에서는 크리스탈 발진이 되지 않기 때문에
오실레이터를 통해 클럭이 생성된걸 넣어 주어야 살아 난다!!! ㅠㅠ
결국은 클럭 소스를 만들어 줘야 하는 상황 ㅠㅠ 


흑흑 Atmega8의 TQFP 패키지는 이렇게 생겨 먹었고.. XTAL1에 클럭을 넣어줘야 하니..


저 핀에 점퍼를 날려서 하면 참.. 쉽죠? 가 될 거 같을.... 리가 있나!!! ㅠㅠ 망했어요!!!! ㅠㅠ


아 몰라.. 되다 안되다 해서 모르겟네..
일단 ATTINY2313 1개는 Ext Crystal로 갔다가 되돌렸는데
다시 시도해보니 연타로 3개 날려버림! ㅠㅠ

결론 : 망했어요 ㅠㅠ



인공호흡 방법
[링크 : http://turbocrazy.tistory.com/241]
[링크 : http://blog.naver.com/eom913/126826512]

Atmega8 데이터시트
[링크 : http://www.atmel.com/images/atmel-2486-8-bit-avr-microcontroller-atmega8_l_datasheet.pdf]

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

ATmega128 + LC1628 제어하기 1  (0) 2013.12.24
lc1628 예제 소스  (0) 2013.12.20
avr pud(pull up disable)  (0) 2013.12.19
AVR-GCC Program space  (0) 2013.12.19
ATmega128 BOOTSZ  (0) 2013.12.19
Posted by 구차니