'잡동사니'에 해당되는 글 12627건

  1. 2013.12.22 하드가... 하드가!!! ㅠㅠ
  2. 2013.12.22 스팀 연말 할인 시작!!
  3. 2013.12.20 cron / crontab
  4. 2013.12.20 lc1628 예제 소스
  5. 2013.12.20 Atmega8 으앙 쥬금!!! ㅠㅠ
  6. 2013.12.19 avr pud(pull up disable)
  7. 2013.12.19 AVR-GCC Program space
  8. 2013.12.19 ATmega128 BOOTSZ
  9. 2013.12.18 AVROSP
  10. 2013.12.18 AVR soft reset
개소리 왈왈/컴퓨터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 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 19. 14:31
예전 회사에서 작업중에
내부 풀업으로 인해 Tri-state로 되지 않아 I2C를 제대로 하지 못했던 기억이 있어 찾아 보니
PUD 설정 기본값은 0이 아닐까 싶다.
걍.. 덤프해볼까...


그리고 PUD 는 SFIOR 레지스터의 0x04 값으로 모든 포트와 모든 핀에 적용이 된다. 
특정 포트만 pull-up을 끌수가 없다는 거.. (alternative랑은 상관없으려나?) 

[링크 : http://www.atmel.com/Images/doc2467.pdf]


+ 2016.03.30

[링크 : http://kakkustudy.tistory.com/46]

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

lc1628 예제 소스  (0) 2013.12.20
Atmega8 으앙 쥬금!!! ㅠㅠ  (0) 2013.12.20
AVR-GCC Program space  (0) 2013.12.19
ATmega128 BOOTSZ  (0) 2013.12.19
AVROSP  (0) 2013.12.18
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 19. 11:32
어떻게 보면.. const 키워드랑 비슷한데

폰노이만 방식이 아닌 하버드 아키텍쳐의 특성상 분리된 주소 공간을 가지는 상황에서
플래시 저장된 데이터를 이용함으로서 SRAM의 공간을 확보하는 방법이다.

The AVR is a Harvard architecture processor, where Flash is used for the program, RAM is used for data, and they each have separate address spaces. It is a challenge to get constant data to be stored in the Program Space, and to retrieve that data to use it in the AVR application.

[링크 : http://www.nongnu.org/avr-libc/user-manual/pgmspace.html

그런 이유로.. gcc implement 상으로는
const 형으로 데이터를 저장하고
읽을때는 LPM(Load Program Memory) 어셈명령을 이용하여 읽게 된다.
#define PGM_P   const char *
#define pgm_read_byte_near (   address_short )    __LPM((uint16_t)(address_short))
 
[링크 : http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html]  

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

Atmega8 으앙 쥬금!!! ㅠㅠ  (0) 2013.12.20
avr pud(pull up disable)  (0) 2013.12.19
ATmega128 BOOTSZ  (0) 2013.12.19
AVROSP  (0) 2013.12.18
AVR soft reset  (0) 2013.12.18
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 19. 10:05
부트로더 사이즈의 약자인거 같은데
부트로더를 사용하기 위해서는 퓨즈 비트도 변경되어야 하고 추가로 부트 영역의 크기를 지정할 수 있게 된다.
Atmega64와 Atmega128은 플래시 크기가 달라서 아래 표기되는 start address의 값이 달라진다.


BOOTSZ - 부트로더의 크기를 설정함
BOOTRST - 0x0000 이 아닌 부트로더 영역에서 시작하도록 함


 If a Boot Loader is implemented, it can be called either directly from the Application code using calls or jumps, or by programming the BOOTRST Fuse. When the BOOTRST Fuse is programmed, the CPU will start execution in the Boot Loader section on Reset, instead of starting at address 0. The BOOTRST Fuse can be changed using Serial or Parallel Programming.
 

[링크 : http://www.atmel.com/images/doc1644.pdf]


LB는 전체에 대한 메모리 보호를 하지만


BLB0프로그램에서 부트로더 영역을 읽고 쓰지 못하도록 하고 
BLB1부트로더에서 부트로더 영역을 읽거나 쓰지 못하도록 하는 설정이다(자체 보호 기능)


Boot Lock Modes (BLB)
Store Program Memory (SPM)

[링크 : http://www.atmel.com/images/doc1644.pdf] 


Load Program Memory (LPM)
[링크 : http://www.atmel.com/Images/doc1233.pdf]

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

avr pud(pull up disable)  (0) 2013.12.19
AVR-GCC Program space  (0) 2013.12.19
AVROSP  (0) 2013.12.18
AVR soft reset  (0) 2013.12.18
AVR Studio / avr-libc bootloader  (0) 2013.12.18
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 18. 18:32
만든데가 사라졌나.. 은근 구하기 힘드네..
AVR 부트로더를 이용한 AVR 업로드 프로그램이다.



[링크 : https://code.google.com/p/nsk-embedded-downloads/]

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

AVR-GCC Program space  (0) 2013.12.19
ATmega128 BOOTSZ  (0) 2013.12.19
AVR soft reset  (0) 2013.12.18
AVR Studio / avr-libc bootloader  (0) 2013.12.18
COM26T2844VTX LCD 데이터 시트  (0) 2013.07.23
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2013. 12. 18. 14:28
결국(?)은 와치독을 이용해서 리셋 시키는 것 외에는 없는걸려나?

[링크 : http://support.atmel.com/bin/customer.exe?=&action=viewKbEntry&id=21]
[링크 : http://bomoolchanggo.blogspot.kr/2009/10/avr-atmega128-software-reset.html]

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

ATmega128 BOOTSZ  (0) 2013.12.19
AVROSP  (0) 2013.12.18
AVR Studio / avr-libc bootloader  (0) 2013.12.18
COM26T2844VTX LCD 데이터 시트  (0) 2013.07.23
ST-23G / EL-23G 가지고 놀기  (0) 2013.07.07
Posted by 구차니