Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Pic18f4550 movwf PORTD not working

Status
Not open for further replies.

selfish

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