프로그램79 8051/4051 Timers Program for timer mode0 #include /* Include x51 header file */ sbit test = P1^0;/* set test pin 0 of port1 */ void timer_delay()/* Timer0 delay function */ { TH0 = 0xE3;/* Load 8-bit in TH0 (here Timer0 used) */ TL0 = 0x14;/* Load 5-bit in TL0 */ TR0 = 1;/* Start timer0 */ while(TF0 == 0);/* Wait until timer0 flag set */ TR0 = 0;/* Stop timer0 */ TF0 = 0;/* Clear timer0 flag */ } void main() { T.. 프로그램/마이컴 2020. 3. 4. 8051/4051 UART Interrupt #include /* Include x51 header file */ void Ext_int_Init() { EA = 1;/* Enable global interrupt */ ES = 1; /* Enable serial interrupt */ } void UART_Init() { TMOD = 0x20;/* Timer 1, 8-bit auto reload mode */ TH1 = 0xFD;/* Load value for 9600 baud rate */ SCON = 0x50;/* Mode 1, reception enable */ TR1 = 1;/* Start timer 1 */ } void Serial_ISR() interrupt 4 { P1 = SBUF;/* Give received data on port.. 프로그램/마이컴 2020. 3. 3. 8051/4051 UART 8051 UART Serial communication Registers SBUF: Serial Buffer Register SCON: Serial Control Register Bit 7:6 - SM0:SM1: Serial Mode Specifier SM1 SM0 0 0 1/12 of Osc frequency shift register mode fixed baud rate 0 1 8-bit UART with timer 1 determined baud rate 1 0 9-bit UART with 1/32 of Osc fixed baud rate 1 1 9-bit UART with timer 1 determined baud rate /* * 8051_Serial_UART */ #include /* Incl.. 프로그램/마이컴 2020. 3. 3. 8051 LED Blinking Program Keil 컴파일러 이용 #include /* Include header file */ void delay(k) /* Delay for msec. (here Xtal freq. is 11.0592 MHz) */ { int i,j; for (i=0;i 프로그램/마이컴 2020. 3. 3. Notepad++ 에서 python 실행하기 1. Notepad++ 플러그인 메뉴에서 "Plugins Admin..." 선택 2. "Plugins Admin..."에서 Search에서 nppexec 입력하여 검색 3. 설치된 NppExec 플러그인에서 "Execute..." 를 선택 4. "Execute..."창에서 python 실행 등록 ①. 를 선택 ②. Command 에 파이선 실행 스크립트 등록 NPP_SAVE "파이션 위치" "$(FULL_CURRENT_PATH)" ③. "Save..." 버튼을 눌러서 등록 5. 사용방법 ①. python 파일 작성 후 저장 ②. NppExec/Execute 단축키 "F6" 을 눌러 실행 (메뉴로 접근 가능) ③. NppExec/Execute 창이 뜨면 "OK" 버튼을 눌러서 실행 프로그램/python 2020. 3. 2. python, pip 특정버전 선택하여 설치하기 python 라이브러리 설치시 특정 버전을 선택하여 인스톨하는 방법 패킷 분석하는 scapy 최신 버전은 2.4.3 인테 2.4.2 버전을 설치할때. pip install scapy==2.42. 프로그램/python 2019. 10. 22. python .ipynb -> .py 변한 방법 jupyter notebook 위에서 작업하면 그 파일이 .ipynb 라는 특별한 포맷으로 저장이됨. 콘솔에서 다음과 같이 작업합니다. pip install jupyter 설치가 오~래 걸립니다. 설치된 후 ( ipynb 파일이 있는곳에서) jupyter nbconvert --to script example.ipynb 파이썬파일로 변환이 가능합니다. 프로그램/python 2019. 10. 1. 이전 1 ··· 4 5 6 7 다음 💲 추천 글