HWP Document

Similar documents
Real Time In-Circuit Emulator for MICROCHIP PIC16CXX

Microsoft Word - elcd_manual.doc

MPLAB C18 C

KAERITR hwp

Microsoft Word - PIC16x_Section20_Comparator_31020a.doc

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

Microsoft Word - PIC16x_Section05_CPU_ALU_31005a.doc

슬라이드 1

Microsoft PowerPoint - PICkit2 Hands-On Training.ppt

[8051] 강의자료.PDF

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A636C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

59

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A634C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

목차 Section 2. Oscillator Section 3. Reset Section 4. Architecture Section 5. CPU and ALU Section 6. Memory organization Section 7. Data EEPROM Section

SRC PLUS 제어기 MANUAL

2014밝고고운동요부르기-수정3

2005프로그램표지

텀블러514

1

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

21993A.book

歯설명서_020925_.PDF

T100MD+

CANTUS Evaluation Board Ap. Note

MicrocontrollerAcademy_Lab_ST_040709

2주차: 입출력 제어 복습

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

hwp

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

Microsoft PowerPoint - AVR 시리얼 통신.ppt [호환 모드]

Microsoft PowerPoint - Chapter 8_USART Serial Communication

Microsoft PowerPoint - 부호기와 복호기.PPT

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

MR-3000A-MAN.hwp


(......).hwp

Microsoft Word - STM32 BxCAN.doc

MODBUS SERVO DRIVER( FDA7000 Series ) STANDARD PROTOCOL (Ver 1.00) 1

PowerPoint 프레젠테이션

CPX-E-SYS_BES_C_ _ k1

PRO1_09E [읽기 전용]

0x00 Contents 0x About Nickster 0x Analaysis 0x Exploit

Microsoft Word - 1. ARM Assembly 실습_xp2.doc

-. Data Field 의, 개수, data 등으로구성되며, 각 에따라구성이달라집니다. -. Data 모든 의 data는 2byte로구성됩니다. Data Type는 Integer, Float형에따라다르게처리됩니다. ( 부호가없는 data 0~65535 까지부호가있는

UART.h #ifndef _UART_H_ #define _UART_H_ #define DIR_TXD #define DIR_RXD sbi(portd,4) cbi(portd,4) #define CPU_CLOCK_HZ UL UART PORT1 void UAR

인터럽트 * 인터럽트처리메커니즘 ATmega128 인터럽트 2

6주차.key

버퍼오버플로우-왕기초편 10. 메모리를 Hex dump 뜨기 앞서우리는버퍼오버플로우로인해리턴어드레스 (return address) 가변조될수있음을알았습니다. 이제곧리턴어드레스를원하는값으로변경하는실습을해볼것인데요, 그전에앞서, 메모리에저장된값들을살펴보는방법에대해배워보겠습

정보보안 개론과 실습:네트워크

PowerPoint 프레젠테이션

놀이동산미아찾기시스템

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다.

Chapter ...

Microsoft PowerPoint - 9.Serial.pptx

99-18.hwp

untitled

hd1300_k_v1r2_Final_.PDF

목차 제 1 장개요 제 2 장소프트웨어구조 제 3 장공통요소 I

Microsoft Word - HLCD통합매뉴열.DOC

AN_0005B_UART

歯FDA6000COP.PDF

<4D F736F F D20B0B3B9DFC8AFB0E65FB4D9BFEEB7CEB5E55FB5F0B9F6B1EBBCB3C1A42E646F63>

Microsoft PowerPoint - ccs33_bios_com1_semaphore.ppt [호환 모드]

ARDUINO Open Physical Computing Platform 오탈자, 문의및보완이필요한내용은 으로알려주세요.

Microsoft Word - FunctionCall

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3

(SW3704) Gingerbread Source Build & Working Guide

PowerPoint 프레젠테이션

K&R2 Reference Manual 번역본

AVR-GCC SRAM 에서의변수및상수특별히속성을정하지않고변수를정의하면 SRAM 영역에저장된다. 이것들은외부메모리에저장되는경우에비하여빠르게엑세스할수있다. 축약표현은 <stdio.h> 에정의되어있다. 그러나, <io.h> 를인클루드하면내부적으로 <stdio.h> 파일을자

인터럽트 (Interrupt) 범용입출력포트에서입출력의내용을처리하기위해매번입출력을요구하는플래그를검사하는일 (Pollong) 에대하여마이크로컨트롤러에게는상당한시간을소비하게만든다. 인터럽트란 CPU가현재처리하고있는일보다급하게처리해야할사건이발생했을때, 현재수행중인일을중단하고

Section 03 인터럽트활성화와인터럽트서비스루틴연결 34/82 장치에대한인터럽트설정과활성화 내부장치에대한특수레지스터존재 장치의특성을반영한동작설정용또는상태관찰용비트로구성 인터럽트사건의발생패턴을설정해야함 인터럽트활성화비트를 1 로셋하여, 인터럽트발생을허락» 전제, 전역

歯메뉴얼v2.04.doc

그룹웨어와 XXXXX 제목 예제

M16_32KIT_Manual.hwp

개요

CAN 통신

Microsoft PowerPoint - polling.pptx

BC6DX-II Korean.ai

PRO1_16E [읽기 전용]

DCR-HC15

Microsoft Word _whitepaper_latency_throughput_v1.0.1_for_

ATmega128

화판_미용성형시술 정보집.0305

untitled

Stepper Motors

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

ÆÊÇ÷¿

BY-FDP-4-70.hwp

0.1-6

Microsoft Word - PEB08_USER_GUIDE.doc

<BDC7C7E83520BFB9BAF1BAB8B0EDBCAD2E687770>

AN2629

Chapter #01 Subject

FARA PLC N70plus 시스템 사용자 메뉴얼

Book1

PowerPoint Presentation

Microsoft PowerPoint - chap01-C언어개요.pptx

Rev V0. Date 0 /0/ PICFA 확장형개발보드매뉴얼. 제품소개및특징. 제품소개 < 그림.> PICFA 확장형개발보드사진 Microchip사의 비트프로세서인 PICFA MCU를이용하여학습및개발을할수있는 PIC 확장형개발보드입니다. 초보자를세심하게배려하기위하여

Transcription:

KSControl.com TITLE 'Middle ware UART PIC16C711' LIST P=16C711 INCLUDE "P16C711.INC" [OSC=HS 4MHz OSC,WDT=ON] [ KAESUNG CONTROL_Jong-Kyoon Lee / www.kscontrol.com ] =============================================== [ Working Register Define ] TMP_W EQU 20H TMP_PSW EQU 21H TrxStsR EQU 22H TxDatR EQU 23H RxDatR EQU 24H BitCnt EQU 25H TstCnt EQU 26H TMRtmr EQU 27H TMR01S EQU 28H TMR1S EQU 29H BitDefine! TrxStsR TstrngF EQU 0 TxDoF EQU 1 TstrBF EQU 2 TstpBF EQU 3 RxDoF EQU 4 RxDoneF EQU 5 [ Port_A Bit-Define ] [ Port_B Bit-Define ] RxDin EQU 0 TxDout EQU 1 [Constant Define ] #define _C STATUS,C #define _Z STATUS,Z #define _ROMpge0 bcf PCLATH,3 #define _ROMpge1 bsf PCLATH,3

#define _RAMpge0 bcf STATUS,RP0 #define _RAMpge1 bsf STATUS,RP0 MSB equ 7 LSB equ 0 STX EQU 02h CR EQU 0Dh LF EQU 0Ah 2400bps TrxBd10 EQU.204 TrxBd15 EQU.152 ////////////////////////////////// ORG 0000H goto INIT ORG 0004 INTPROCmovwf TMP_W swapf STATUS,W bcf STATUS,RP0 movwf TMP_PSW btfsc INTCON,T0IF goto TxDpro btfsc INTCON,INTF goto RxDpro ENDINT swapf TMP_PSW,W movwf STATUS swapf TMP_W swapf TMP_W,W retfie TxDpro btfss TrxStsR,TxDoF btfsc TrxStsR,RxDoF goto RcvByt In Rxing btfss TrxStsR,TstrBF goto SndStrB btfsc TrxStsR,TstpBF goto SndStpB rrf TxDatR btfsc _C bsf PORTB,TxDout bcf PORTB,TxDout decfsz BitCnt bsf TrxStsR,TstpBF SndStrB bcf PORTB,TxDout Send Start-bit movlw.8 movwf BitCnt bsf TrxStsR,TstrBF SndStpB bsf PORTB,TxDout Send Stop-bit bcf TrxStsR,TstrBF bcf TrxStsR,TstpBF bcf TrxStsR,TxDoF

TmrUp incf TMRtmr movlw.240 0.1Sec @ 2400bps subwf TMRtmr,W goto ClT0IF clrf TMRtmr incf TMR01S 0.1Sec User's Timer movlw.10 subwf TMR01S,W goto ClT0IF clrf TMR01S incf TMR1S 1Sec User's Timer ClT0IF movlw TrxBd10 movwf TMR0 bcf INTCON,T0IF goto ENDINT RcvByt bcf _C rrf RxDatR btfsc PORTB,RxDin bsf RxDatR,7 decfsz BitCnt bcf TrxStsR,RxDoF bsf TrxStsR,RxDoneF RxDpro bcf INTCON,INTE bcf INTCON,INTF btfsc TrxStsR,TxDoF goto ENDINT InTxing! RcvStrB movlw.8 movwf BitCnt bsf TrxStsR,RxDoF movlw TrxBd15 1.5Bit Period movwf TMR0 bcf INTCON,T0IF goto ENDINT INIT movlw B'00011000' movwf STATUS clrwdt clrf PORTA movlw B'00000001' movwf PORTB clrf INTCON bsf STATUS,5 movlw B'10010011' RTCC x 16 movwf 81H OPTION_REG clrf TRISA movlw B'00000001' movwf TRISB bcf STATUS,5 clrf TrxStsR clrf PORTA movlw B'00000011' movwf PORTB movlw B'10110000'

movwf INTCON ----------------------------------- <<<< MAIN ROUTINES >>>> /// Test Loop MAIN clrwdt call RxPro call TxStrng call UserPGM 사용자루틴 goto MAIN // UserPGM에서 보낼데이터있음버퍼에보낼스트링옮긴후 bsf TrxStsR,TstrngF로전송할문자있음을표시 수신이필요할경우아래두줄 bcf INTCON,INTF bsf INTCON,INTE Permit RxRcv! 을실행후 RxPro에서 1바이트혹은스트링수신구현 //////SUB/////// TxStrng btfss TrxStsR,TstrngF Present String to Send? No! bcf INTCON,INTE Rx Masking btfsc TrxStsR,TxDoF in Txmting a byte! movlw 0 ROM_Addr Pointer_Change if U need! movwf PCLATH incf TstCnt movf TstCnt,W addwf PCL goto TxChar1 goto TxChar2 goto TxChar3 goto TxChar4 goto TxChar# StrLength to Send(if U need!) clrf TstCnt bcf TrxStsR,TstrngF End of Transmit TxData to Send= "HELLO" TxChar1 movlw 'H' TxChar2 movlw 'E' TxChar3 movlw 'L' TxChar4 movlw 'L'

TxChar5 movlw 'O' TxChar#movf UsrReg,W RxPro btfss TrxStsR,RxDoneF bcf INTCON,INTE Inhibit RxRcv! movf RxDatR,W movwf UsrReg // User RcvProc bcf TrxStsR,RxDoneF Reset Rx_Done Flag! UserPGMnop User Working Program END Coded by J.K Lee ///// 하드웨어 UART와소프트웨어 UART의중간의장단점을갖는방법을생각하다보니 Middle-Ware UART 라는어중간? 한이름을붙이게되네요. 하드웨어 UART 를사용하는것이제일낫기는하지만, 칩의선택문제라든지, 통신처럼중계하는용도 로는한개의하드웨어 UART로는모자랄경우소프트웨어 UART 를구현하게되는데, 소프트웨어방 식의가장큰문제점은타이밍을흐트리지않기위해서는송수신중루프내에서머물러야하는제약이 다른일을못하게만드는단점이있습니다. 특히, 시간적으로수신하는동안수신루틴에서만머무를수없는 FND다이내믹표시라든가하드웨어 적으로꼭처리해야하는일이있을경우소프트웨어방식은쓸수없습니다. 이런문제점을해결하는방법으로, TMER를이용한준하드웨어방식의 UART구현의방법론을알려드 리니응용해보실만할겁니다. [ 개요 ] 1. 사용하는크리스탈이나보오래이트에맞겠금적절히 TMER(ex:TMR0) 의프리스케일러값을세트합니다. 이렇게할경우인터럽트주기는머신싸이클/ 프리스케일러/256의보레이트를갖는인터럽트주기가될것입니다. 2. 여기에서, 매인터럽트를끝내고나오는시점에원하는보레이트가되는값을 TMR0에릴로드시 키고 T0IF 를클리어시키고빠져나오는구조를갖춥니다. ( 예: 4Mh크리스탈일경우프리스케일러 를 2 분주로했을때, d204를릴로드시키면 9600bps, 152를릴로드시키면 4800bps 의인터럽트주기를갖습니다) [ 주] 본코드는디버깅을거치지않은프로그램으로세세한부분에손볼필요도있을겁니다.