*중*
Bronze개인인증
팔로워0 팔로우
소개
등록된 소개글이 없습니다.
전문분야 등록된 전문분야가 없습니다.
판매자 정보
학교정보
입력된 정보가 없습니다.
직장정보
입력된 정보가 없습니다.
자격증
  • 입력된 정보가 없습니다.
판매지수
전체자료 26
검색어 입력폼
  • coherent/noncoherent detector, quadrature receiver, BPSK,QPSK,BPSK
    Project #2디지털통신Using the C++ with Visual studio다음과 같은 시스템을 가정하자.RateCode Vector1/3111110111101Problem 1.(a) 위와 같은 code vector 를 가지는 convolutional encoder 를 가정하자. information.txt 를 encoder 의 input data 로 받은 후, 위의 encoder 를 통과하였을 때 나오는 output 값을 구하고 encoder_output.txt 에 저장하시오.주어진 인코더의 Code Vector가 1111 1011 1101 이고 rate가 1/3이기 때문에 input 1bit에 따라서 output 3bit가 발생한다.. 따라서 코딩을 할 때는 1111에서 나오는 output은 conv[0]에 저장하고 1011에서 나오는 output은 conv[1]에 저장하소, 1101에서 나오는 output은 conv[2]에 저장해서 차례로 출력했다.encoder_output.txt에 결과를 기록하였다.(b) 위의 encoder 에 대한 Trellis diagram 을 그리시오. (no simulation)이 인코더는 shift register가 4개이므로 8개의 state가 존재하게 된다. 8개의 노드가 스테이트마다 존재하므로 이 인코더에서는 적어도 t5까지는 가야지만 merging이 일어나는 점이 나타나며 그 이후부터는 패턴이 반복된다. 이를 이용하여 비터비 디코딩을 할 수 있다.(c) (a)에서 구한 encoder output 에 임의로 10 개의 error 가 발생했다 가정하고 이를 Viterbi decoding 기법을 이용하여 decision 하고 원래의 information bit 과 비교 후 분석하여 channel encoding 에 대해 설명하시오.원래의 information bit를 인코딩한 encoder output이 아닌 encoder_output2를 만들어 인코딩된 300개의 비트중 임의로 10개를 바꾸어 디코딩을 해보았다.결과는 다음과 같다.그림에서 볼수있듯이 오류는 발생하지 않았다.위와 같은 결과가 나오는 이유는 채널코딩을 하였기 때문이다.보통 압축을 하고 전송하는 과정에서 발생한 오류는 전체 시스템에 막대한 영향을 미친다. 보통 오류를 줄이기 위해서는 전력을 증가시켜 SNR을 크게 해야하는데, 이는 고비용, 채널간 전력을 증가시켜 비효율적이다. 그래서 디지털 시스템에서는 전력을 증가시키지 않고서도 오류 발생확률을 낮추는 오류정정부호를 사용한다. 이는 디지털 데이터가 전송 될때 언제 어디서 발생할지 모르는 데이터 유실 또는 변경을 어느정도 막고 혹시 유실 또는 변경 되었더라도 이것을 제대로 복원 할수 있게 데이터를 추가/재정렬 하는 방법인 것이다. 특히 디지털 통신의 경우 이러한 과정이 매우 중요한데...1또는 0이 전송되는 디지털 통신에서 약간의 노이즈로 인해 1이 0으로 0이 1로 바뀌게 된다면 처음 보내고자 하는 정보가 완전히 다른 정보가 되기 때문에 채널 코딩을 한다. channel coding은 원 데이터 보다는 데이터 양이 좀더 늘어나게 되는데 예를 들어 1/2 코딩을 하게 되면 이것은 우리가 보내고자 하는 데이터의 두배를 보낸다는 뜻이다. 분모의 값이 클수록 데이터 양은 늘어나지만 오류가 날 확률은 적어질 것이다.Problem 2.임의의 bit stream 을 발생시키고, 위의 encoder 를 거친 convolutional encoded bits 를 BPSK modulation( ) 이용하여 AWGN channel 을 통해 전송 후 이를 Viterbi decoding 기법을 이용하여 까지 신뢰핛 수 있는 BER 곡선을 그리시오. 그리고 convolutional coding 을 하지 않았을 때의 성능과 비교하시오. (Viterbi decoding block size 는 100 개, 은 0dB~8dB , information bit 의 개수는 약 개, code vector 는 위와 같음)우선 코딩을 할때 project1에 쓴 BPSK를 사용하였으며 가우시안함수도 프로젝트1에서 사용한 함수를 그대로 사용하였다.결과가 나왔으나 100개의 블록사이즈로 100000개씩 반복문을 돌리다보니 시간소요가 너무 많았다. 특히 코딩을 잘못하여서 그런지는 모르겠지만 다 돌리는데 거의 2시간정도 소요가 되었다. 작성한 코드에 convolutional encoder를 거치지않고 디코딩하는 소스가 있고 제대로 동작하는 것을 확인하였다.이에 반하여 길쌈부호화를 하지않은 BPSK복조의 경우 BER이 거의 10배정도 증가한 것을 알수있는데 이것은 채널부호화 과정을 거치게 되면 내용물(data)이 깨지지 않은 것은 아니고 data가 깨진 사실을 알게 해 주거나(error detection), 깨진 data를 깨지기 전의 상태로 복원(error correction) 시켜준다는 것을 알 수 있다.이는 부호화시 신호간의 유클리드 거리를 최대로 함으로써 복호화시 비터비 디코더의 검출에러를 줄여서 부호화이득을 높이기 위한 것이다.appendix : 소스코드// *******************************************************************// // CREATED: Dec 21, 2010// DESCRIPTION: Convolutional encoding, Viterbi Decoding// DATE OF CHANGE:// MODIFIER:// DESCRIPTION OF CHANGE:// *******************************************************************#include #include void main(){FILE *f, *g;f=fopen("information.txt","r");g=fopen("encoder_output.txt","w");int reg[4],conv[3]; //shift register와 인코딩비트 저장int i,a;for(i=0;i
    공학/기술| 2011.06.01| 17페이지| 3,000원| 조회(456)
    미리보기
  • 디지털통신 Using the C++ with Visual studiㅐ (BPSK , QPSK)
    Project #1디지털통신Using the C++ with Visual studioProblem 1.Bit sequence {1 0 1 1 0 1 0 1}를 다음 방법으로 modulation하였다.(data rate:R _{b} =2kbps ,bit energy=1)BPSK (carrier frequency :f _{0}, andPHI _{1} = 0 orpi )QPSK (f _{0}=8kHz,PHI _{1}=0,pi /2,pi , 3pi /2 )BFSK (f _{0}=8kHz,f _{1} =f _{0} + TRIANGLE f,` TRIANGLE f>0)BPSK Modulation(a) BPSK, QPSK의 송신 신호의 파형을 그리고 관찰하시오.QPSK ModulationBPSK는 페이즈가 0과pi 로 구별하는데 비트스트림 1에서 0으로 100일 때 페이즈가 바뀌어 불연속이 되는 것을 확인할수 있고 200일 때 역시 바뀌며 101이 되고 400까지는 페이즈가 같으니 1011이 된다음 500에서 다시 바뀌어 101100이 되고 600과 700에서 페이즈가 바뀌어 불연속이 되어 비트스트림 10110010이 제대로 변조되었다는 것을 알수 있다.QPSK는 위상이PHI _{1}=0,pi /2,pi , 3pi /2 인 네 개의 신호로 구별하며 그레이 코딩을 하면11일 때 위상이 0, 10일 때pi /2, 00일 때pi , 01일 때 3pi /2이다.비트스트림은 10110010이므로 10 11 00 10 네 개의 심볼로 나뉘는데 그림에서 보면 10과 11의 위상차이 때문에 불연속이 되고 00과 10역시 위상차이 때문에 불연속이 되는 것을 관찰할 수 있다.(b) BFSK에 대해 coherent/noncoherent detector에서의 orthogonality를 만족하는 mininum tone space를 구하시오.coherent detector에서 orthohonality를 유지하기위한 minimum tone space는 1/2T이고 여기서 T는 1/R인데 R은 주어진 rent 디텍터에서 minimum tone space는 2000Hz이다.이를 이용하여 BFSK 변조를 하면 다음과 같다.BFSK ModulationBFSK에서는 서로다른 주파수의 직교인 신호를 사용하므로 신호간의 주파수차이로 심볼을 구분한다. 그림에서 보면 1,3,4,7번째의 주파수가 같은 것을 알 수 있고 2,5,6,8번째의 주파수가 같은 것을 알 수 있어 10110010의 비트스트림이 제대로 변조된 것을 알 수 있다.Problem 2.Problem 1.의 bit sequence를 BFSK로 modulation하였다. Noncoherent receiver중 하나인 quadrature receiver를 이용하여, 신호를 detection하려 한다.(a)TRIANGLE f가 minimum tone space의 0.5배, 1배, 2배일 때 각각의 original bit sequence와 detector output를 비교하라.교재에 있는 quadrature receiver는 다음과 같다.그림과 같이 코딩을 하였고 결과는 다음과 같다.MTS123456780.5배101100101배101100102배10110010(b) 위의 결과를 참고하여 minimum tone space에 대해 설명하라.BFSK의 경우는 M=2인 경우로서 두 개의 signal을 이용해서 modulation 한다. 그런데 이 두 개의 signal은 Orthogonal 해야 하므로 minimum tone spacing을 구해서 signal을 modulation하도록 frequency를 정해야 한다. 두 개의 frequency f1과 f2가 orthogonal 하다는 것은 과 를 곱해서 적분한 것이 0이 된다는 의미이다. 즉, f1으로 전송된 signal에 대해서 f2애 맞춰진 receiver output filter의 sampled envelope이 0이 되어야 한다. FSK signaling set tone 사이의 orthogonality가 있는 것은 set 내의 어떤 pair of tone 이던지 hogonal 하다. 따라서 zero crossing과 peak가 같이 일어나므로 두 signal은 서로 영향을 주지 않는다.하지만 frequency의 차이가 작을 때는 f1에서 s2가 0이 아니고 양의 값으로 살아 있으므로 값이 s1의 값이 나타나는 것이 아니고 s2가 더해진 값으로 그려지게 된다. 그걸 알아보기 위하여 코딩을 하였으나 노이즈값을 주지않아서이기 때문인지 톤스페이스에 상관없이 결과를 모두 제대로 나오는 것을 확인할수 있었다.Problem 3.임의의 bit stream을 발생시켜 Problem 1.과 같이 modulation하고, AWGN channel에 통과시킨 다음, coherent receiver를 이용해 신호를 detection하려 한다.(a)3가지 방법(BPSK,QPSK,BPSK)에 해당하는 coherent receiver를 설계한다.Coherent receiver란 변조된 수신파로부터 위상이 변화하지 않는 기준반송파를 만들어 이것을 기준으로 하여 변조 파의 위상을 검출하는 방법이다. Coherent detection은 지연검파와 비교 시 기준반송파의 재생이 필요하다는 점에서 회로 구성이 약간 복잡하게 되지만, 기준반송파에 수신되는 잡음성분을 포함하지 않기 때문에 오류율특성이 매우 좋다.Coherent detection of BPSK는 maximum likelihood detector를 사용한다.이것은 들어온 신호 r(t)에 대해 reference signal을 사용하는 방법이다BFSK는 frequency의 차이를 이용해서 signal을 구분하는 방법이다. 따라서 detection 또한 frequency를 이용해서 하도록 설계했다.. FSK는 모든 signal이 orthogonal 하게 signal을 설정하기 때문에 자기 자신 이외의 모든 signal과는 ogrthogonal 하다. 따라서 reference signal을 사용된 f0와 f0+1/2T로 설정하면 같은 주파수를 가진 signal이 들어올 때 만 값을 가지게 된다.QPSK는 곡선을 그려라.BFSKQPSK SERQPSK BER(c)위의 결과를 참고하여, BPSK와 BFSK 그리고 BPSK와 QPSK를 비교 분석하여라.BPSK와 BFSK 비교BPSK와 BFSK 모두 nosie의 power가 커질수록 즉, noise의 분산이 작아질수록 error probability가 작아짐을 알 수 있다. coherent BPSK 변조 방식의 경우, 두 신호 사이의 거리는 위상차가 180도 나기 때문에 가 되고, BFSK는 위상차가 90도 나기 때문에 신호 사이의 거리가 가 된다. 따라서 같은 error performance를 나타내주기 위해서 BFSK의 신호 power를 2배가량 즉, 3dB를 더 올려주어야 한다. 이것은 위의 그래프에서도 확인 할 수가 있다. 거의 동일한 BER에 대해서 BPSK는 3dB, BFSK는 6dB의 Eb/No로 3dB 차이가 남을 볼 수가 있다.bandwidth 측면에서 보아도 BPSK가 더 유리하다. BFSK는 두개의 주파수를 필요로 하기 때문에 그만큼 차지하는 주파수 대역도 커진다. 이를 통해 Eb/No을 고정시켰을 때 나오는 error performance와 BW 효율 둘 다 BPSK가 더 좋음을 확인 할 수가 있다.BPSK와 QPSK 비교BPSK와 QPSK의 BER이 동일하다는 전제조건은 QPSK에서 Gray coding을 했을 경우이다.심벌은 실제 전송되는 파형일때 BPSK에서는 2개의 심벌이 존재하고, 각각 0, 1 bit에 대응되고 QPSK는 4개의 심벌이 존재하고 각각 00, 01, 11, 10 bit에 대응된다.SER은 심벌이 얼마나 에러가 나느냐 따지는 것이고, BER은 Bit 가 얼마나 에러가 나느냐 따지는 것이다. QPSK에서는 1symbol당 2bit 가 존재하므로 E=2Eb가 된다.QPSK에서 BER은 SER의 절반이 되는이유는 Gray Coding 방식 때문에 생긴다. Gray Coding은 인접 심벌끼리 1bit만 차이가 나게 하는 코딩방법이다.그레이 코딩을 한 결과 1심볼에러 = 1비트 에때문에 3dB차이가 난다.Appendix : 소스코드// ******************************************************// FILE NAME:// AUTHOR:// CREATED: nov 20, 2010// DESCRIPTION: BPSK,BFSK,QPSK modulation// DATE OF CHANGE:// MODIFIER:// DESCRIPTION OF CHANGE:// ******************************************************#include #include #include #include #define phi 3.14void main(){/////////////////////////////////////////////////////////////////////////////변수 선언///////////////////////////////////////////////////////////////////////////FILE *f, *f1, *f2;f=fopen("1-BPSK.txt","w");f1=fopen("1-QPSK.txt","w");f2=fopen("1-BFSK.txt","w");double bpsk[15][100];//그래프를 그릴 데이터를 저장double qpsk[15][100];double bfsk[15][100];int bit[8];bit[0]=1,bit[1]=0,bit[2]=1,bit[3]=1,bit[4]=0;bit[5]=0,bit[6]=1,bit[7]=0;//10110010을 저장double Ea=1;int i,j,mts=2000;double f0=8000;double Rs1=2000,Rs2=2000/2; //k가 1인 경우와 2인 경우double T1=1/Rs1,T2=1/Rs2;double w0=2*f0*phi;double w1=2*(f0+mts)*phi; //BFSK 모듈레이션에서 사용double A1=sqrt(2*Ea/T1),A2=sqrt(2*Ea/T2);d0;i
    공학/기술| 2011.06.01| 15페이지| 5,000원| 조회(694)
    미리보기
  • 예비-라인트레이서종합
    Preparation report #9전기전자응용실험Chap 9~12. Line Tracer 통합과목명.전기전자응용실험담 당.제출일.성 명.1. IntroductionIn this report, I'll take into account overall structure of the line tracer. First, I'm going to investigate the fundamental principles of line tracer. And then, determine the specific parts which are composed of line tracer.2. Equipments and components- Power Supply, Multimeter and Oscilloscope- Motor (DC or Step)- 80C196KC kit, Win-196 application program- LM324, LM293, EL-7L, ST-7L.- Various resistors, capacitors, LED and other elements etc.3. Theory1) Chapter 9① Research what line tracer is and how it operates.The Line Tracer is a machine that tracks a black line on the floor. This technology applied to cargo transport unmanned vehicles in industry. This machine detect the line itself, have to finish the track with its own power. To achieve this object study for sensor as eye, motor as foot and processer as head will be required. The applications of these part on machine and program developound.2) Chapter 10① Research on the type of sensors and characteristics.- Temperature Sensor : Temperature sensor is the sensor that convert temperature information to electrical signal.- Humidity Sensor : Humidity sensor is a sensor that convert humidity information to electrical signal and present it to quantity which can measure.- Magnetic sensor : Magnetic sensor is a sensor which use magnetic character to measure some quantity.- Infrared sensor : Infrared sensor is a sensor which use infrared ray to transport information.② Explain some of the sensors fit for line tracers and list the reasons for the selection.We are going to choose below elements.- Radiation/Detecting element : ET-7L and ST-7L.The reason why,- In line-tracer, we want sensing line.- In this case the line can be sense with color.- So we use some infrared sensor to sensing color.- In infrared sensor, that elements are plentifully used.3) Chapter 11① Research on the type of motors and characteristics.- DC motorA DC mor a submultiple of the supply frequency. The magnetic field on the rotor is either due to current transported with slip rings or a permanent magnet. The second type is the induction motor, which turns slightly slower than the supply frequency. The magnetic field on the rotor of this motor is created by an induced current.② Explain some of the motors fit for line tracers and list the reasons for the selection.The processor send signals to motors to drive them which are 0 and 1. But the transmission of the AC signal is complicate. So using the DC motor or the Step motor is reasonable. They are light, cheap and have a simple structure. Step motor control a rotating angle so if we use a step motor, the controling the line tracer is more accurate than using the DC motor. But using step motor is so complex to driving circuit. Therefore, we use a DC motor first. If we get a right result of driving line tracer, we use a step motor.③ Research on the motor driver circuit for the selected motor at capacitors as shown in the diagram below. A larger bypass capacitor between Vcc and GND is effective against noise and other problems.(A capacitance higher than 100㎌ is recommended)4) Chapter 12① Draw a design of the body based on the block diagram of a line tracer drawn in chapter 8, sensor board and motor board.The sensor board will be located at the bottom of the line tracer to sensing a line. Then it will be connected to DC motor board with two 4-pin connectors to supply 5V and send 2-bit signal from the sensor. The motor board will be connected to 20-pin connector to get 5V and 12V, motor control signals from the kit. It will send the 2-bit signal from sensor board to the micro processor. The 20-pin connector will be connected with 40-pin connector in order to give inputs and get outputs from the micro processer of which expander uses 40-pin connector.- Schematics of Sensor BoardFirst, To control infrared sensing part, we consider the above schematic composed of LM324 and other 0x05) motor = 0x00;// if sensed value is 0101, Error : Stopif(sensor == 0x06) motor = 0x0a;// if sensed value is 0110, Line is in center : Go straightif(sensor == 0x07) motor = 0x02;// if sensed value is 0111, Line is on Right : Turn rightif(sensor == 0x08) motor = 0x04;// if sensed value is 1000, Line is on left : Turn left fastif(sensor == 0x09) motor = 0x00;// if sensed value is 1001, Error : Stopif(sensor == 0x0a) motor = 0x00;// if sensed value is 1010, Error : Stopif(sensor == 0x0b) motor = 0x00;// if sensed value is 1011, Error : Stopif(sensor == 0x0c) motor = 0x04;// if sensed value is 1100, Line is on left : Turn left fastif(sensor == 0x0d) motor = 0x00;// if sensed value is 1101, Error : Stopif(sensor == 0x0e) motor = 0x04;// if sensed value is 1110, Line is on Left : Turn leftif(sensor == 0x0f) motor = 0x00;// if sensed value is 1111, Error : StopPORT1 = motor;} while(1);//infinite loop}② Propose an appropriate algorithm for a line tracer.We will use a 4 sensors for accurat
    공학/기술| 2011.06.01| 11페이지| 2,500원| 조회(143)
    미리보기
  • 예비8
    Preparation report #8전기전자응용실험Chap 8. DC and Step Motor control과목명.전기전자응용실험담 당.제출일.성 명.1. IntroductionIn chapter8, we can familiarize with various functions designed to control DC and step motor. There are 3 objectives in this chapter. Those are following. First, Make phone ringtone using PWM. Second, Control the speed and direction of a DC motor using PWM. The last, Control the speed and direction of a step motor using HSO.2. Equipments and components80C196KC kit, PC and MDA-WIN196 software3. Theory① Step motorA stepping motor is called step motor or reluctance motor and used wide industrially. The motor is used at location controling, typically used in location of stopping accuracy. The most recently, the motor is wildly used in semiconductor's transferring. The reason is that the motor control structure is simple and has good location accuracy when stopping at regular position because the motor has closed loop control structure. Therefore sub motor vibrate regularly to have regular lg sub driver's gain. on the other hand, in case of the stepping motor, the motor has open loop control structure. The motor doesn't vibrate when stop so it is used in semiconductor equipment. And the motor proper in low speed.② DC motorThe DC motor can wide and high accuracy speed control and has good resistance of load. So the DC motor is used in heavy starting torque.1) Good at controling of wide and high speed.2) Can chose randomly starting and accelerating torque so the torque utility factor is good.3) More expensive than induction motor4) Needed regular maintenance and inspection5) Have restriction to make high speed and high voltage because of a brush③ Pulse Width Modulation (PWM)We can use switch or relay for simple ON/OFF control of motor, but it is mot easy to change the speed of motor. The simplest way to change speed of DC motor is controling the voltage. But most voltage except the voltage supplied to the motor slip away as loss(heat), i.e., the efficiency is very low. Instond and OFF for 9 seconds, entirely it slows by 1/10. That is, we control speed with the ratio of ON/OFF. This is the PWM methode. In reality the control is executed with much faster speed.To control motor speed with direct current is difficult so we control current to motor by changing a variable resister between power supply and motor. This methode has drawback of energy loss at the resistor. So we use PWM(Pulse Width Modulation). In PWM, switch is on for t1 and off for t2. We change the ratio of t1 and t2, duty ratio. For t1 we control FET that control the current to the motor.With high frequency of duty ratio, we can get uniform output as the average of t1 with less loss of semiconductor because of the limit of the motor response. the control efficiency is higher than 95% with the whole range of motor speed 0~100%.4. Understanding of the program① Make a short music using the following frequencies.Do = 256 [Hz]Re = Do x 9/8 = 288 [Hz]Mi = Re x 10/9 = 320 [Hz]Fa = Mi x 16/15 = 341 [H 480 [Hz]Do = Ti x 16/15 = 512 [Hz]#pragma model(kc) /* 80C196KC select */#pragma interrupt(pulse=3,check=7)#include /* defined SFR include*/#define SELECT (*( unsigned char *)(0x100c))/*define global variable that flag and interrupt counter*/unsigned char flag, flag1, count;unsigned int time; //define time constant/*TIMER2 interrupt function*/void sound(){if(flag1==0){ //2sec silencePORT1^=0x01; //if not 2sec silence, speaker on/offTIMER2=time; //define TIMER2 time constant}; //interrupt counter -1count--;if(count==0) flag=0xff; //flag set when interrupt counter is 0}/*H sound output*//*20[MHz]/2=10[MHz](0.1us). 0.8(us) because the every 8 state counts1/480[Hz]=2.08[mS], 2.08[mS]/0.8[uS]=2600*/void high(){count=24; //save the 480[Hz] half priod valuetime=(66536-2600/2); //save half priod time counstant valueTIMER2=time;flag=0; //flag clearPEND1=0; //interrupt enableMASK1=0x10PORT1=0x01;enable(); //run interrupt function?while(flag!=0xff); //interrupt disabledisable();MASK1=0;PEND1=0;e the every 8 state counts1/320[Hz]=3.125[mS], 3.125[mS]/0.8[uS]=3906*/void low(){count=16; //save the 320[Hz] half priod valuetime=(65536-3906/2); //save half priod time counstant valueTIMER2=time;flag=0; //flag clearPEND1=0; //interrupt enableMASK1=0x10;PORT1=0x01;enable(); //run interrupt function?while(flag!=0xff); //interrupt disabledisable();MASK1=0;PEND1=0;flag=0;}/*2sec silence*/void sec2(){count=50; //2sec time constant initial selectflag1=0xff; //2sec flag ontime=(65536-50000); //save 0.04sec time constantTIMER2=time;flag=0; //flag clearPEND1=0; //interrupt enableMASK1=0x10;PORT1=0x01;enable(); //run interrupt function?while(flag!=0xff); //interrupt disabledisable();MASK1=0;PEND1=0;flag=0;flag1=0;/*main program*/void main(){unsigned char count;IOC0=0x02; //TIMER2 resetIOC1=0x00; //TIMER2 interrupt vector 28WSR=1;IOC3=0x01; //internal clockWSR=0;flag=flag1=0; //flag clearSELECT=0xef; //speaker selectPORT1=0xe6; //speaker offPORT2=0xdf; //LED off/*infinity loop*/do{/*When you rt
    공학/기술| 2011.06.01| 10페이지| 1,500원| 조회(114)
    미리보기
  • 예비7
    Preparation report #7전기전자응용실험Chap 7. Control Experiment using 80C196KC Microcontroller과목명.전기전자응용실험담 당.제출일.성 명.1. IntroductionIn chapter7, by using C language, we will practice basic functions and operations of microcontrollers through 80C196KC kit. Especially, we want to focus on practice the operation of PORT0 ,1 and practice the use of interrupts and timers.2. Equipments and components80C196KC kit, PC and MDA-WIN196 software3. Theory① I/O PORTEach of the five I/O ports has an associated Special Function Register(SFR) to read or write the port pins. Some of the I/O ports have an additional SFR that reconfigures the port pin to support an alternate function. Not all port SFRs are both readable and writeable. Also, not all SFRs exist in the same horizontal window(e.g., the SFR control registers are written in HWindow 0 but read back in HWindow 15).IOPORT0, IOPORT1, and IOPORT2 are the SFRs used to read Port 0, read/write Port 1, and read/write Port 2, respectively. These registers have the stack and then clears the PSW and INT_MASK1.3. The LDB INT_MASK1 instruction enables those interrupts that you choose to allow to interrupt the service routine.4. The EI instruction re-enables interrupt processing and inhibits interrupt calls until after the next instruction executes.5. The actual interrupt service routine executes within the priority structure established by the software.6. At the end of the service routine, the POPA instruction restores the original contents of the PSW, INT_MASK1, and WSR registers; any changes made to these registers during the interrupt service routine are overwritten.③ TimerTimer 1 is 16-bit timer. In 20Mhz , 1-state time is 0.1㎲. If timer 1 register is overflow(0xFFFF ⇒ 0x0000), then IOS1.5 is "1". If timer 1 register is IOC1.2=1, MASK 0=1, then timer 1 will occur timer 1 overflow interrupt.In 80C196KC , all timer 2 functions is controlled SFRs. The following table is functions of PORT2 pins using in timer 2.4. Understanding of the program1) 0) through DG2111 analog switch, SW5 is PORT0.7(AD7). A toggle switch SW0 is connected with LED0 and the right 7-segment, push button switch SW5 is connected with LED1 and second 7-segment. If we control SW0 and SW1, then output is showed LED & 7-segment.Third program is external interrupt program. First state is that 7-segment will show '1110 ', LED0 will be lit. If we press SW4 repeatedly, LED1, LED2, LED3 additional lighting to turn the 7-segment. And we press SW4 three times, all LEDs illuminates, and 7-segment showed '0000'. Once again SW4 pressed, It will go back to its initial state.4th program is external interrupt priority program. First state is that LED0 is ON, and 7-segment '7', after a short period of time, LED0 will turn OFF, LED3 turn ON, and 7-segment will show '29' automatically because of interrupt vector.5th program is Timer 1 program. Timer 1 occurs overflow every 52.4ms. Then clear and reset. LED0 ~ LED3 will turn ON sequentially, 7-segment, 1110 → 1101 → 1011 → 01 if we adjust delay time longer, then LEN ON time is longer. But delay time maximum is 60000. Therefore, we will code delay(60000); line repeatedly.② Software interrupts - If MASK.7 and I flag is set to 1 to PEND.7 in software requests interrupt and starts the interrupt handling function. Rewrite the program so that PEND.7 is set to 1 in an appropriate time interval and execute it. By an appropriate time interval can be made using the delay function in the previous sections.We will adjust likewise next code.do {PORT1 = led;digit = 0;if(led & 0x01) digit |= 0x0001; /* examine sw0 */if(led & 0x02) digit |= 0x0010; /* examine sw1 */if(led & 0x04) digit |= 0x0100; /* examine sw2 */if(led & 0x08) digit |= 0x1000; /* examine sw3 */FND = digit; /* display by 7-segment */PEND = 0x80;delay(60000);delay(60000); /* wait interrupt */} while(1); /* infinite loop */Whatever input come the hexadecimal PEND, when it changed binary, MSB must be 1. So, 10000000 (2) = 0x80 is enough to it.③ Rewrite the pll be longer.We will check IOS1.5 because the timer 1 overflow examined. So we will adjust likewise next code.void main( void ){unsigned int digit; /* FND output local variable */SELECT = 0xfe; /* led choose connected I/O */FND = 0; /* 7-segment clear */PEND = 0; /* clear PEND register */led=0xfe; /* led ON initial value */count = 0; /* clear interrupt count */do {PORT1 = led;digit = 0;if(led & 0x01) digit |= 0x0001; /* examine LED0 */if(led & 0x02) digit |= 0x0010; /* examine LED1 */if(led & 0x04) digit |= 0x0100; /* examine LED2 */if(led & 0x08) digit |= 0x1000; /* examine LED3 */FND = digit; /* display by 7-segment */if(IOS1 & 0x20) over(); /* additional part */} while(1); /* infinite loop */④ From program 7-5, if you push SW4 and let go, the counter of TIMER2 changes by 2 numbers. Rewrite the program so that the counter increments by one and execute it.We will adjust likewise next code.count = TIMER2/2;The line count = TIMER2/2; means that timer 2's counter changes 1.⑤ Rewrite the l
    공학/기술| 2011.06.01| 6페이지| 1,500원| 조회(140)
    미리보기
전체보기
받은후기 2
2개 리뷰 평점
  • A+최고예요
    1
  • A좋아요
    1
  • B괜찮아요
    0
  • C아쉬워요
    0
  • D별로예요
    0
전체보기
해캠 AI 챗봇과 대화하기
챗봇으로 간편하게 상담해보세요.
2026년 06월 04일 목요일
AI 챗봇
안녕하세요. 해피캠퍼스 AI 챗봇입니다. 무엇이 궁금하신가요?
3:21 오전
문서 초안을 생성해주는 EasyAI
안녕하세요 해피캠퍼스의 20년의 운영 노하우를 이용하여 당신만의 초안을 만들어주는 EasyAI 입니다.
저는 아래와 같이 작업을 도와드립니다.
- 주제만 입력하면 AI가 방대한 정보를 재가공하여, 최적의 목차와 내용을 자동으로 만들어 드립니다.
- 장문의 콘텐츠를 쉽고 빠르게 작성해 드립니다.
- 스토어에서 무료 이용권를 계정별로 1회 발급 받을 수 있습니다. 지금 바로 체험해 보세요!
이런 주제들을 입력해 보세요.
- 유아에게 적합한 문학작품의 기준과 특성
- 한국인의 가치관 중에서 정신적 가치관을 이루는 것들을 문화적 문법으로 정리하고, 현대한국사회에서 일어나는 사건과 사고를 비교하여 자신의 의견으로 기술하세요
- 작별인사 독후감