Jump to content
ELFORUM - Forumul Electronistilor
Sign in to follow this  
Guest mickydutza

Un mic ajutor, va rog....

Recommended Posts

Guest mickydutza

org	0x00	goto	initorg	0x04	goto ISR	;-------------------------------------------------------------------------------; Init code;-------------------------------------------------------------------------------org	0x20init		clrf OptionR	movlw b'01000000' ; front crescator	movwf OptionR	clrf Intcon	movlw b'0001000' ; intrerupere externa pe RB0/INT	movwf Intcon	bsf Intcon,GIE		goto mainISR		movlw b'01100000' ; aprind 2 LED-uri	movwf PortB	bcf Intcon,INTF	retfie;------------------------------------------------------------------------------; Main loop;------------------------------------------------------------------------------	main		goto main	;-----------------------------------------------------------------------------	end

Unde gresesc? Deci, vreau ca la apasare unei taste (RB0/INT = 1) sa aprind 2 Led-uri.

Share this post


Link to post
Share on other sites

Guest mickydutza

Daca te referi la initializarea portului B uite codul pe care l-am scris

clrf Status	clrf PortB	bsf Status,RP0	movlw b'10011111'	movwf TrisB

Share this post


Link to post
Share on other sites

e bun initul, numai sa nu uitzi sa revii in bank0 dupa ce umbli la tris. asta pesupunand ca secventa de mai sus face parte din secventza de initzializare a programului, cum nu reiese clar din ce spui tu. posteaza tot , nu-tzi fie frica ca-tzi fura cineva ideile :yawinkle:

Share this post


Link to post
Share on other sites
Guest mickydutza

Am reusit sa gasesc si greseala, in init-ul portului INTCON, setam bitul 3 nu bitul 4 aka intrerupere externa permisa, deci ..... nu activa intreruperile externe. Ms oricum.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Sign in to follow this  

×
×
  • 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.