1 ,LED, - Hara Laboratory Home Page ?? セラロック発振子は3ピンのうち中央のピンを0Vに接続し, 外側の2ピンをPICのOSC1とOSC2 に接続する(この2 ピンは対称なので, どちらをどちらに接続してもよい). 2. LED をRB1 に接続する. 抵抗の接続を忘れないこと. 4 RB1 の出力が0V

  • Published on
    30-May-2018

  • View
    212

  • Download
    0

Embed Size (px)

Transcript

<ul><li><p>[2012.04.02]</p><p>2</p><p>PIC 8 .</p><p>.</p><p>1. .</p><p>1</p><p>(4/16, 6/ 4)</p><p> LED</p><p>1</p><p>( 4/17, 6/ 5)</p><p>2</p><p>(4/23, 6/11)</p><p> PIC LED</p><p> PIC</p><p>2</p><p>( 4/24, 6/12)</p><p>3</p><p>(5/7, 6/18)</p><p> PIC</p><p> V1</p><p>3</p><p>( 5/8, 6/19)</p><p>4</p><p>(5/14, 6/25)</p><p> V1</p><p> V2</p><p>V1 V2</p><p>4</p><p>( 5/15, 6/26)</p><p>5</p><p>(5/21, 7/ 2)</p><p> V2</p><p>V2</p><p>V2</p><p>( 5/28, 7/ 9)</p><p>2. .</p><p> 40% 60% .</p><p> .</p><p>1 , LED,</p><p>LED 7 , LED</p><p>. , .</p><p>1 LED , LED .</p><p> .</p><p>1</p></li><li><p> ,.</p><p> , (). 5 10 mA.</p><p> .</p><p>F G H I JA B C D E123456</p><p>123456</p><p>7 7</p><p>5V</p><p>0V</p><p>5</p><p>()</p><p> 2 1, LED.</p><p> .</p><p> 3 LED,.</p><p> LED, 7 LED,. .</p><p> , 7 LED. () 0V LED. VCC 5V.</p><p> 7 LED.</p><p>a</p><p>g</p><p>d</p><p>f b</p><p>e c</p><p>dp</p><p>VCC</p><p>f</p><p>g</p><p>e</p><p>d</p><p>a</p><p>b</p><p>c</p><p>dp</p><p>VCC</p><p> 4 (7447) 4, 4 2, LED.</p><p> , 4 2, LED.</p><p>2</p></li><li><p> . (D,C,B,A) 4, D . ( 0).</p><p>14</p><p>13</p><p>12</p><p>11</p><p>10</p><p>8 GND</p><p>f</p><p>9</p><p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>16</p><p>15</p><p>g</p><p>a</p><p>b</p><p>c</p><p>d</p><p>e</p><p>Vcc</p><p>A</p><p>D</p><p>RBI</p><p>RBO</p><p>LT</p><p>C</p><p>B</p><p>7447</p><p>D C B A a b c d e f g0 0 0 0 0 0 0 0 0 0 0 10 0 0 1 1 1 0 0 1 1 1 10 0 1 0 2 0 0 1 0 0 1 00 0 1 1 3 0 0 0 0 1 1 00 1 0 0 4 1 0 0 1 1 0 00 1 0 1 5 0 1 0 0 1 0 00 1 1 0 6 1 1 0 0 0 0 00 1 1 1 7 0 0 0 1 1 1 11 0 0 0 8 0 0 0 0 0 0 01 0 0 1 9 0 0 0 1 1 0 0</p><p> LT, RBI, RBO. , 5V.</p><p> , 0, 1. , ( AD). 1, 0</p><p>Vcc</p><p>A</p><p>GND</p><p>Vcc</p><p>GND</p><p>A</p><p> 5 4, 2, LED 1. 2 NAND.</p><p> 74LS00 (2 NAND 4 IC). .</p><p> ,,.</p><p> (, 0 LED).</p><p> 74LS00 , 0 8 mA , 1 0.4mA, LED.</p><p> 0, 1NOT. .</p><p> 10 0 9. 10 10 dont care,.</p><p>3</p></li><li><p>14</p><p>13</p><p>12</p><p>11</p><p>10</p><p>8GND</p><p>Vcc</p><p>9</p><p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>74LS00</p><p> 1 1 5,.</p><p> 2 PIC LED</p><p>8 PIC, LED. , 2 PIC.</p><p>PIC Peripheal Interface Controller,. ,. , 35. EEPROM,.</p><p> 6PIC LED.</p><p>1. PIC (PIC16F84).</p><p> .</p><p> GND 0V, Vcc 5V.</p><p> MCLR 5V. 0V PIC.</p><p> 3 0V, 2 PIC OSC1 OSC2 ( 2,).</p><p>2. LED RB1.</p><p> .</p><p>4</p></li><li><p> RB1 0V.</p><p>3. .</p><p> PIC, ().</p><p>4. 1 LED timer.asm.</p><p> C:Y=picY=timer.asm..</p><p> MPLAB IDE.</p><p> MPLAB IDE ()</p><p> [Project] [Project Wizard][]</p><p> Step One: Device: PIC16F84[]</p><p> Step Two: Active Toolsuite: Microchip MPASM Toolsuite[]</p><p> Step Three: Project Name: (kadai6)Project Directory: C:Y=pic []() Project Name () (50)</p><p> Step Four: C:Y=picY=timer.asm[Add &gt;&gt;] (timer.asm)[]</p><p> []</p><p> [Project] [Make] (F10)</p><p> OutputBUILD SUCCEEDED</p><p> timer.hex.</p><p> 6</p><p> (kadai6)[Project] [open] (c:Y=picY=kadai6.mcp)[]</p><p> timer.asm (kadai6.mcw) kadai6.mcp Source Files timer.asm</p><p> Output BUILD FAILEDOutputERROR</p><p>5. timer.hex PIC PIC</p><p> PICpro</p><p> PICpro</p><p> Chip Selector PIC16F84</p><p>5</p></li><li><p> Window PIC PIC, [Load]c:Y=picY=timer.hextimer.hex [Program] PIC[yes]</p><p>() (WDT) on/off</p><p> HS off</p><p>6. PIC,.</p><p>7. ,,.</p><p> 7 LED.</p><p> 2 PAtoPB.asm,,,.</p><p> RA RB,.</p><p> PIC,,</p><p>TIM10 MOVLW 0F9H</p><p>,</p><p> [TAB] []</p><p>. [TAB]. [TAB],.</p><p> PICRA ON/OFF</p><p> 8PIC RA03 4RB03LED 2 LEDPICPAtoPB.asm</p><p> 9PIC</p><p>1. RB47 LED LED </p><p>2. 3 dispnum.asm PIC01RA023</p><p>3. RA1, RA2, RA345, 67, 89</p><p>() .</p><p> , (). ,.</p><p>6</p></li><li><p> ,, t.</p><p> 2 6 9,.</p><p> 3 V1</p><p> 1,.</p><p> 10 2 10,.</p><p>1. 4 (countup.asm).</p><p>2. ,.</p><p> INCF,, 16. 10.</p><p> 11,.</p><p> 2 10. 9.</p><p> , 6.</p><p> (MCLR),.</p><p> 1 (RA0) 1. 1 0, 1, 2,3,,. 9 0, 10.</p><p> 10 (RA1) 10. 2 0, 1,2, 3,,. 9 0, 1, 2,.</p><p> (RA2)</p><p> (RA3)</p><p> (RA4)</p><p> 2 (1 + 2 + 3 =). ,.</p><p> .</p><p>2 3</p><p> 1 : 4 2 1</p><p>7</p></li><li><p> 2 : 1 2 2</p><p> 3 : 2 1 2</p><p> 39</p><p>10 1 10100 10 1 10100</p><p>1100 1100 1001 1001</p><p>10 0 10000 10 0 10000 01 0 10000 01 0 10000</p><p>3 9</p><p>3 9</p><p>39</p><p>1</p><p>2</p><p>3</p><p>,.</p><p> 3 10 11,.</p><p> 4 V1 V2</p><p> 1,. , 2.</p><p> 12 V1.</p><p> ,. ,,.</p><p> 13 V1, V2.</p><p> ,.</p><p> .</p><p> 3.</p><p> . .</p><p> ,/. ,,.</p><p> 40,.</p><p> 4 12 13,,.</p><p>8</p></li><li><p> 5 Ver 2</p><p> 14 V2.</p><p> 40,.</p><p> V2, , , , .</p><p> .</p><p>1. V2.</p><p>2. .</p><p>3. (,//). ().</p><p>4. .</p><p> . (,)</p><p>[]</p><p> .</p><p> .</p><p> , 12 + 34 = - 235 + =,.</p><p>[]</p><p> ,.</p><p>[]</p><p> .</p><p> ,.</p><p> ,,.</p><p> .</p><p> . .</p><p> ,.</p><p> .</p><p> ,.</p><p> .</p><p>9</p></li><li><p> 1 LED (timer.asm); *************************************************; 0.50.5 PORTB ON/OFF; 10MHz 0.5; *************************************************LIST P=PIC16F84 ;; </p><p>INCLUDE "P16F84.INC" ;; </p><p>CNT1 EQU 0CH ;; CNT1 0C CNT2 EQU 0DH ;; 000B CNT3 EQU 0EH</p><p>ORG 0 ;; </p><p>MAIN ;; ()BSF STATUS,RP0CLRF TRISB ;; PORTB BCF STATUS,RP0</p><p>MAINLP ;; CLRF PORTB ;; PORTB 0 (LED )CALL SECTIM ;; (0.5)MOVLW 0FFH ;;MOVWF PORTB ;; PORTB 1 (LED )CALL SECTIM ;; (0.5)GOTO MAINLP</p><p>;; TIM10 MOVLW 0F9H</p><p>MOVWF CNT1TIMLP1 NOP</p><p>DECFSZ CNT1,FGOTO TIMLP1RETURN</p><p>TIM100 MOVLW 0F9HMOVWF CNT2</p><p>TIMLP2 CALL TIM10DECFSZ CNT2,FGOTO TIMLP2RETURN</p><p>SECTIM MOVLW 5MOVWF CNT3</p><p>TIMLP3 CALL TIM100DECFSZ CNT3,FGOTO TIMLP3RETURN</p><p>END</p><p> 2 LED (PAtoPB.asm);***************************************; RA0 -- RA3 -&gt; RB0 -- RB3;***************************************</p><p>LIST P=PIC16F84INCLUDE "P16F84.INC"</p><p>ORG 0MAIN</p><p>BSF STATUS,RP0MOVLW 0FHMOVWF TRISACLRF TRISBBCF STATUS,RP0</p><p>MAINLP ;; A B MOVFW PORTAMOVWF PORTBGOTO MAINLP</p><p>END</p><p>10</p></li><li><p> 3 (dispnum.asm); ***********************************; RA0 OFF -&gt; "01"; RA0 ON -&gt; "23"; ***********************************</p><p>LIST P=PIC16F84INCLUDE "P16F84.INC"</p><p>CNT1 EQU 0CHCNT2 EQU 0DHCNT3 EQU 0EHCOUNT EQU 0FH</p><p>ORG 0</p><p>MAINBSF STATUS,RP0MOVLW 01FHMOVWF TRISA ;; PORTA CLRF TRISB ;; PORTB BCF STATUS,RP0</p><p>MAINLP MOVLW 01HBTFSC PORTA, 0CALL WAITCALL DISPGOTO MAINLP</p><p>WAIT CALL SECTIMBTFSC PORTA, 0MOVLW 23HRETURN</p><p>DISP MOVWF PORTBRETURN</p><p>TIM10 MOVLW 0F9HMOVWF CNT1</p><p>TIMLP1 NOPDECFSZ CNT1,FGOTO TIMLP1RETURN</p><p>TIM100 MOVLW 0F9HMOVWF CNT2</p><p>TIMLP2 CALL TIM10DECFSZ CNT2,FGOTO TIMLP2RETURN</p><p>SECTIM MOVLW 5MOVWF CNT3</p><p>TIMLP3 CALL TIM100DECFSZ CNT3,FGOTO TIMLP3RETURN</p><p>END</p><p>11</p></li><li><p> 4 (countup.asm); ***********************************; (0.5 ); ***********************************LIST P=PIC16F84INCLUDE "P16F84.INC"</p><p>CNT1 EQU 0CHCNT2 EQU 0DHCNT3 EQU 0EHCOUNT EQU 0FH</p><p>ORG 0</p><p>MAINBSF STATUS,RP0MOVLW 01FHMOVWF TRISA ;; PORTA CLRF TRISB ;; PORTB BCF STATUS,RP0CLRF PORTBCLRF COUNT ;; COUNT=0MOVLW 0AH</p><p>MAINLPCALL SECTIMINCF COUNT,F ;; COUNT++CALL CHECKMOVF COUNT,WMOVWF PORTB ;; COUNT PORTB GOTO MAINLP</p><p>CHECKMOVLW 0FHANDWF COUNT, 0 ;; 4bit 0SUBLW 0AHSKPZ ;; 4bit 0AH RETURNRETURNMOVFW COUNTADDLW 6 ;; 4bit 0aH+6MOVWF COUNT</p><p>MOVLW 0F0HANDWF COUNT, 0 ;; 4bit 0SUBLW 0A0HSKPZRETURN ;; 4bit 0AH RETURNCLRF COUNT ;; 4bit 0AH COUNT=0RETURN</p><p>TIM10 MOVLW 0F9HMOVWF CNT1</p><p>TIMLP1 NOPDECFSZ CNT1,FGOTO TIMLP1RETURN</p><p>TIM100 MOVLW 0F9HMOVWF CNT2</p><p>TIMLP2 CALL TIM10DECFSZ CNT2,FGOTO TIMLP2RETURN</p><p>SECTIM MOVLW 5MOVWF CNT3</p><p>TIMLP3 CALL TIM100DECFSZ CNT3,FGOTO TIMLP3RETURN</p><p>END</p><p>12</p></li></ul>

Recommended

View more >