잉여 백수라 할일도 없어서 전화를 받는데
전화 내용이 뻔하다랄까.. 


나이
성별
박근혜 정부가 정책운영을 잘하는지
신용카드 선호 브랜드
사용 카드에 대한 만족도
선호 자동차 브랜드 
주유소 연상 브랜드
가장 많이 사용하는 주유소
선호 편의점
선호 화장품 브랜드
해당 화장품 브랜드 만족도
선호 대기업 회장
직업
가족 월 평균 소득
이념적 성향 - 보수/중도/진보
지지 정당 - 새누리/민주당/통진당/정의당/기타
성별 

머.. 이런거 물어는데..
왜 뜬금없이 박근혜와 신용 카드 그리고 소비성향에 대한 걸 물어 보니 싶긴한데


결론!
02-303-4878 번호는 오면 받지 말고 끊어버려!! 돈 아까워!!

검색을 해보니 원링전화!!
끄아아!!! 통화료 나오겠네!! ㅆㅂ!! 5분 30초나 걸리던데!!!!
Posted by 구차니
헐.. 언제부터 이런게 생겼지 ㅋㅋㅋ
현재 테스트에 사용한 버전은 글쓰는 시점 최신버전인
1.8.4 64bit 버전이다.


E 드라이브에 폴더 하나 만들어서
저장소 하나 생성하니 저장소가 생성되었다고 뜨고
아래의 "Create folder strcuture"를 누르고 저장소를 보니


헐?!?! ㅋㅋㅋ
촘 짱인듯?


'프로그램 사용 > Version Control' 카테고리의 다른 글

mercurial SCM  (0) 2014.05.02
git 간편 설명서  (0) 2014.03.06
svn relocate 사용하기  (0) 2013.08.27
svn + apache on ubuntu  (0) 2013.08.27
TortoiseSVN 1.16 과 1.17의 호환성  (0) 2012.09.16
Posted by 구차니
게임/마비노기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 구차니