Continue to Site

[PIC] Pic18f4550 movwf PORTD not working

Status
Not open for further replies.

selfish

Newbie level 5
Newbie level 5
Joined
Feb 23, 2008
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,345
Dear friends,

Following is a part of my programme. this part is executed every 10 mili second.

I expect the portd to function as a counter and increment every 10ms. (TRISD is all output)

However i get the output only on the PORTD,1. This confirms the the TM in incremented as expected , but movwf PORTD is not working.

I was struggling with this for more than a week but no success. Can someone help?





First part
Code:
	incf	TM  

	movf	TM
	movwf	PORTD

Second part for testing
Code:
	btfss	TM,1
	goto	ON
	goto	OFF
ON
	bsf		PORTD,1
	goto	LCD0
OFF
	bcf		PORTD,1
 
Last edited by a moderator:

For output you have to use LATx for 18F devices.
 

For output you have to use LATx for 18F devices.

Hi Milan,

Thank you for the response.

I thought if btfss works direct on the PORT movwf should also work.

Anyway i will try LATD also and see.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top