Jump to content
ELFORUM - Forumul electronistilor

unde dai si unde crapa !


Recommended Posts

Salutare ! Se da urmatorul cod assembly , simplu si raspicat .Se doreste aprinderea unor leduri pe port B , in 2 loop uri dupa cum urmeaza :---intr-un loop se aprinde 4 leduri din port B 0,5sec , pausa 0,5 s , apoi 3 leduri timp de 0,5 sec , pausa 0,5 sec , de trei ori --- in alt loop se aprind secvential ledurile portului B ( numai 7 din 8) tot de trei ori Secventa se reia la infinit . Unde gresesc , ca dupa compilare si scriere a pic ului nu e ceea ce am dorit sa se intample !!!"unde dai si unde crapa"!Daca insa las doar o singura bucla , oricare ar fi ea, totul e ok . list p=16f628a include __config 0x3D18 org 0x00 movlw 0x07 movwf CMCON bsf STATUS,RP0 ;select bank 1 movlw b'00000000' movwf TRISB movwf TRISA bcf STATUS,RP0 ;select bank 0 CMCON equ 1Fh STATUS equ 03h cblock 0x20 a7 a8 countneg countclip endc clrf PORTA clrf PORTB start movlw d'3' movwf countneg negativ call neg decfsz countneg goto negativ movlw d'3' movwf countclip clip call cli decfsz countclip goto clip goto start cli movlw b'00000111' ; clip alternativ SEX apoi SHOP movwf PORTB call Delay_005s clrf PORTB call Delay_005s movlw b'11111000' movwf PORTB call Delay_005s clrf PORTB call Delay_005s neg clrf PORTB ; litera negativa call Delay_005s movlw b'11111110' movwf PORTB call Delay_005s movlw b'11111101' movwf PORTB call Delay_005s movlw b'11111011' movwf PORTB call Delay_005s movlw b'11110111' movwf PORTB call Delay_005s movlw b'11101111' movwf PORTB call Delay_005s movlw b'11011111' movwf PORTB call Delay_005s movlw b'10111111' movwf PORTB call Delay_005s movlw b'11011111' movwf PORTB call Delay_005s movlw b'11101111' movwf PORTB call Delay_005s movlw b'11110111' movwf PORTB call Delay_005s movlw b'11111011' movwf PORTB call Delay_005s movlw b'11111101' movwf PORTB call Delay_005s movlw b'11111110' movwf PORTB call Delay_005s Delay_005s movlw 0x0E movwf a7 movlw 0x28 movwf a8 Delay_005 decfsz a7, f goto $+2 decfsz a8, f goto Delay_005 goto $+1 nop return end

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines