Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC code help

Status
Not open for further replies.

mr. mister

New Member
i have written a PIC code and need help in knowing if this bit i have written is correct

Processor: 16F84A

basically i am trying to set the MSB of port b high after a series of events, would this be right?

MOVLW b'10000000' ;loading that binary value into the working register
MOVFW portb ;loading this value into port B i hope will set RB7 high
MOVLW 0FF
CALL delay

please i need urgent help :x :x :x
 
mr.mister,
You should change

MOVFW portb ;

to

MOVWF portb ; as this moves the value in w to the file register portb.

MOVFW does the opposite transfer which is not what you want.

Also, MOVLW 0FF is not right. It should be MOVLW 0xFF, the 0x indicates that the number is hex.

Len


[/quote]
 
thanks alot :D

don't have much experience with these pics but its certainly getting more interesting the more i learn

cheers again :D
 
You're welcome,

You should use the Micro Controllers forum. This forum is not for Micro Controllers. You should receive a better response in that forum.

Go to the main menu, it is the fourth one.

Len
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top