2009년 12월 3일 목요일

[VC] ListBox의 ScrollBar 가장 최근에 포커스 주기

 

ListBox의 ScrollBar 가장 최근에 포커스 주는 방법.

엄청 삽질했다. -_-;;

 

시리얼로 데이터가 들어오면 리스트박스에다가 뿌려주는데 정해진 공간을 넘으면 세로로 스크롤바가 생긴다. 근데 이게 맨 첫줄만 계속 보여주지 최근에 들어온 데이터가 들어오는 맽 끝줄은 보이지 않는거다.

 

※ 왼쪽 빨간 박스와 오른쪽 빨간 박스의 차이점을 알겠는가. 사용자가 손으로 긁어 옮긴것이 아니다.

 

젱장.

 

뒤지고, 뒤지고, 또 뒤지고.

 

겔겔거리다가 찾아냈다.

 

오른쪽 Listbox는 control 변수로 m_ctrlCmd02란 이름을 가지고 있고 x는 int형.

 

x = m_ctrlCmd02.GetCount();
m_ctrlCmd02.SetScrollPos(SB_VERT, x);

 

이렇게 해주면 왼다. 카운트 몇개냐? 해서 그 카운트에 스크롤바의 포커스를 옮겨주면 된다.

우여곡절끝에 하긴 했는데 사용하면서 다른 문제가 날지 안날지는 있어봐야 알겠지.

 

훗.

 

 

 

 

+ 덧 +

 

망했다 ㅠㅠㅠㅠㅠㅠ

스크롤바는 내려가는데 화면은 안내려간다 -_-;

뭥미...... 아 어쩐담.

 

 

 

+ 덧 +

다 필요없다.

 

m_ctrlCmd02.SetCurSel(m_ctrlCmd02.AddString(m_strCmd02buff));

 

이거 한 줄이면 처음에 했던 스크롤 어쩌구도 필요없이 포커스까지 갖추면서 스크롤도 함께 내려간다.

굳 乃

2009년 10월 27일 화요일

[AVR] MCU Control Register

MCU Control Register – MCUCR

 

Bit

7

6

5

4

3

2

1

0

 

SRE

SRW10

SE

SM1

SM0

SM2

IVSEL

IVCE

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Initial Value

0

0

0

0

0

0

0

0

 

Bit 7 – SRE: External SRAM/XMEM Enable

Writing SRE to one enables the External Memory Interface.The pin functions AD7:0,

A15:8, ALE, WR, and RD are activated as the alternate pin functions. The SRE bit overrides

any pin direction settings in the respective data direction registers. Writing SRE to

zero, disables the External Memory Interface and the normal pin and data direction settings

are used.

 

Bit 6 – SRW10: Wait-state Select Bit

For a detailed description in non-ATmega103 compatibility mode, see common description

for the SRWn bits below (XMCRA description). In ATmega103 compatibility mode,

writing SRW10 to one enables the wait-state and one extra cycle is added during

read/write strobe as shown in Figure 14.

 

 

2009년 10월 26일 월요일

내 포스팅 검색엔진에 노출시키기

내 포스팅이 검색엔진에 노출되도록 하기 위한 rss 등록 page

 

Naver : http://help.naver.com/service/exMailQuestion.jsp?question_gubn=service&TBID=TBOX20071231000001&sub_tb_id=TBOX20071231000011

 

Daum : http://cs.daum.net/mail/form/15.html

 

Yahoo : http://kr.helpboard.yahoo.com/helpfeedback/s_center.html?p_isblog=Y&p_qtype=1

 

Nate : http://add.nate.com/

 

Paran : http://add.paran.com/

[IAR컴파일러] 인터럽트 서비스 루틴 사용

인터럽트 서비스 루틴

 

#pragma로 인터럽트 주소 지정. ISR 함수명 앞에 “__interrupt” 키워드 추가.

 

Ex) #pragma vector=0x0b

__interrupt void timer0_isr (void)

[AVR] ATmega64와 ATmega128의 차이

 

ATmega64

ATmega128A

Flash (Kbytes)

64

128

EEPROM (Kbytes)

2

4

SRAM (Bytes)

4096

4096

Max I/O Pins

54

53

F.max (MHz)

16

16

Vcc (V)

2.7 – 5.5

2.7 – 5.5

10-bit A/D Channels

8

8

Analog Comparator

Yes

Yes

16-bit Timers

2

2

8-bit Timer

2

2

Brown Out Detector

Yes

Yes

Ext Interrupts

8

8

Hardware Multiplier

Yes

Yes

Interrupts

34

34

ISP

Yes

Yes

On Chip Oscillator

Yes

Yes

PWM Channels

8

8

RTC

Yes

Yes

Self Program Memory

Yes

Yes

SPI

1

1

TWI

Yes

Yes

UART

2

2

Watchdog

Yes

Yes

Pb-Free Packages

MLF (VQFN) 64

TQFP 64

MLF (VQFN) 64

TQFP 64

 

결론적으로는 메모리 차이인거다.

2009년 10월 21일 수요일

[MPLAB IDE 설치] Error 1324. 해결하는 방법

MPLAB IDE 8.30을 설치하려 하는데 시작도 하기 전에

 

Error 1324. The path ?? contains an invalid character.

 

라는 메시지가 떴다.

뭐지? 해서 다음 버전을 받아 보았지만 역시 마찬가지.

 

아무래도 그 컴퓨터 언어가 일본어로 되어있어서 그런 것 같은데 확신은 없는 상황.

 

그래서 그냥 무작정 한국어로 바꿔보기로 결정했다. 결론적으론 해결되었고.

 

 

 

1. 제어판 -> 날짜, 시간, 언어 및 국가별 옵션에 들어간다.

 

 

 

2. 국가 및 언어 옵션에 들어간다.

 

 

 

3. 국가별 옵션 탭에서 한국어를 선택한다.

여기까지 하고 재부팅을 했는데 그래도 똑같은 상황이었다. 결론은 4번. 4번이 가장 중요했다.

 

 

 

4. 고급 탭에 들어가 한국어로 바꿔준다.

이렇게 하고 재부팅 해줬더니 깔끔하게 설치완료. 에휴, 별게 다 말썽이다.

[AVR] Atmega128 Software reset

Software reset이 필요한 경우

 

asm("jmp 0");

 

또는

 

#define WDR asm("WDR")

WDR;

 

이렇게 하면 된다.

 

하드웨어적으로 리셋 시켜주는 편이 더 좋긴 하겠지만...

2009년 10월 19일 월요일

[AVR] ATmega I/O 레지스터

ATmega128 각 포트는 3개의 I/O레지스터를 사용하여 제어할 수 있도록 구성되어 있다.

 

DDRx(Data Direction Register) : 입출력의 방향 설정 (R/W)

PINx(Port Input Pins Register) : 포트 입력 핀 (Only Read)

PORTx : 데이터 출력 (R/W)

 

보통의 마이컴은 입력과 출력 데이터 레지스터를 구분하지 않는데 AVR의 경우 각각의 레지스터를 가진다.

 

 

* Datasheet 보러가기 : Atmega128L

 

* Datasheet 일부 발췌 (60page..)

Three I/O memory address locations are allocated for each port, one each for the Data

Register – PORTx, Data Direction Register – DDRx, and the Port Input Pins – PINx. The

Port Input Pins I/O location is read only, while the Data Register and the Data Direction

Register are read/write.

곰 파비콘(ico파일)

 

멍때리는 곰

정신차렷!