Sari la conținut
ELFORUM - Forumul electronistilor

Circuit cu leduri in multisim


Vizitator myhkai86

Postări Recomandate

Vizitator myhkai86

Am postat acum ceva timp ca am nevoi de un proiect in multisim viewtopic.php?f=23&t=41883. am gasit ceva problema e ca nu functionea. Am atasat o imagine cu schema, cu circuitul in multisim si codul sursa pentru PIC.ma poate ajuta cineva cu o solutie... Cine ma poate ajuta rog sa intre pe ID:myhkai86Codul sursa#include "p16f84.inc" ; This includes PIC16F84 definitions for the MPASM assemblerTIME equ 9FH ; Variable for the delay loop.PORTB equ 06H ; Port B address.TRISB equ 86H ; Port B Tristate address.PORTA equ 05H ; Port A address.TRISA equ 85H ; Port A Tristate address.STATUS equ 03H ; Page select register.COUNT1 equ 0CH ; Loop register.COUNT2 equ 0DH ; Loop register. bsf STATUS,5 ; 1 cycle, 0.5mSmovlw 00H ; 1 cycle, 1.0mSmovwf TRISB ; 1 cycle, 1.5mSmovlw 00H ; 1 cycle, 2.0mSmovwf TRISA ; 1 cycle, 2.5mSbcf STATUS,5 ; 1 cycle, 3.0mSmovlw 00H ; 1 cycle, 3.5mSmovwf PORTA ; 1 cycle, 4.0mS ; Start of main program RUNmovlw 01H ; 1 cycle, 4.5mS movwf PORTB ; 1 cycle, 5.0mS call DELAY ; 2 cycles, 486mS call DELAY ; 2 cycles, 967mS ; Move the bit on Port B left, then pause. rlf PORTB,1 ; 1 cycle, 967.5mS call DELAY ; 2 cycles, 1.45S call DELAY ; 2 cycles, 1.93S rlf PORTB,1 ; 1 cycle, 1.93S call DELAY ; 2 cycles, 2.41S call DELAY ; 2 cycles, 2.89S rlf PORTB,1 ; 1 cycle, 2.89S call DELAY ; 2 cycles, 3.37S call DELAY ; 2 cycles, 3.85S rlf PORTB,1 ; 1 cycle, 3.85S call DELAY ; 2 cycles, 4.34S call DELAY ; 2 cycles, 4.82S rlf PORTB,1 ; 1 cycle, 4.82S call DELAY ; 2 cycles, 5.30S call DELAY ; 2 cycles, 5.78S rlf PORTB,1 ; 1 cycle, 5.78S call DELAY ; 2 cycles, 6.26S call DELAY ; 2 cycles, 6.74S rlf PORTB,1 ; 1 cycle, 6.74S call DELAY ; 2 cycles, 7.22S call DELAY ; 2 cycles, 7.70S rlf PORTB,1 ; 1 cycle, 7.70S ; Now move onto Port A, and move the bit left. rlf PORTA,1 ; 1 cycle, 7.70S call DELAY ; 2 cycles, 8.19S call DELAY ; 2 cycles, 8.67S rlf PORTA,1 ; 1 cycle, 8.67S call DELAY ; 2 cycles, 9.15S call DELAY ; 2 cycles, 9.63S rlf PORTA,1 ; 1 cycle, 9.63S call DELAY ; 2 cycles, 10.11S call DELAY ; 2 cycles, 10.59S rlf PORTA,1 ; 1 cycle, 10.59S call DELAY ; 2 cycles, 11.07S call DELAY ; 2 cycles, 11.55S ; Move the bit back on Port A rrf PORTA,1 ; 1 cycle, 11.55S call DELAY ; 2 cycles, 12.04S call DELAY ; 2 cycles, 12.52S rrf PORTA,1 ; 1 cycle, 12.52S call DELAY ; 2 cycles, 12.99S call DELAY ; 2 cycles, 13.48S rrf PORTA,1 ; 1 cycle, 13.48S call DELAY ; 2 cycles, 13.96S call DELAY ; 2 cycles, 14.44S rrf PORTA,1 ; 1 cycle, 14.44S ; Now move the bit back on Port B rrf PORTB,1 ; 1 cycle, 14.44S call DELAY ; 2 cycles, 14.92S call DELAY ; 2 cycles, 15.40S rrf PORTB,1 ; 1 cycle, 15.40S call DELAY ; 2 cycles, 15.89S call DELAY ; 2 cycles, 16.37S rrf PORTB,1 ; 1 cycle, 16.37S call DELAY ; 2 cycles, 16.84S call DELAY ; 2 cycles, 17.33S rrf PORTB,1 ; 1 cycle, 17.33S call DELAY ; 2 cycles, 17.81S call DELAY ; 2 cycles, 18.29S rrf PORTB,1 ; 1 cycle, 18.29S call DELAY ; 2 cycles, 18.77S call DELAY ; 2 cycles, 19.25S rrf PORTB,1 ; 1 cycle, 19.25S call DELAY ; 2 cycles, 19.73S call DELAY ; 2 cycles, 20.22S rrf PORTB,1 ; 1 cycle, 20.22S call DELAY ; 2 cycles, 20.70S call DELAY ; 2 cycles, 21.18S goto RUN ; 2 cycles, 21.18S ; Subroutine to give a delay between bit movements. ;Total of 957 cycles, 480mS DELAY movlw TIME ; 1 cycle movwf COUNT1 ; 1 cycleLOOP1 ; decfsz COUNT1 ; 9F x 1 cycle + 1 cycle = 160 cycles goto LOOP1 ; 9E x 2 cycles = 316 cycles movwf COUNT1 ; 1 cycleLOOP2 ; decfsz COUNT1 ; 9F x 1 cycle + 1 cycle = 256 cycles goto LOOP2 ; 9E x 2 cycles = 316 cyclesreturn ; 2 cycles END

Link spre comentariu
  • 3 luni mai târziu...
  • Răspunsuri 1
  • Creat
  • Ultimul Răspuns

Creează un cont sau autentifică-te pentru a adăuga comentariu

Trebuie să fi un membru pentru a putea lăsa un comentariu.

Creează un cont

Înregistrează-te pentru un nou cont în comunitatea nostră. Este simplu!

Înregistrează un nou cont

Autentificare

Ai deja un cont? Autentifică-te aici.

Autentifică-te acum



×
×
  • Creează nouă...

Informații Importante

Am plasat cookie-uri pe dispozitivul tău pentru a îmbunătății navigarea pe acest site. Poți modifica setările cookie, altfel considerăm că ești de acord să continui.Termeni de Utilizare si Ghidări