Order of setting registers?

Status
Not open for further replies.

StudentSA

Member
Good Day,

I am using a PIC16F690 Microprocessor, PICKit2 and MPLab IDE to write assembly code.

I would like to find out if the order in which you set your registers is important? Especially the IO port configuration registers.

Eg, would it make a difference if I was to set the ANSEL then TRIS as apposed to TRIS then ANSEL?

Regards,
StudentSA
 
It depends what you have connected to the ports. The safe order is ANSEL, PORT and then TRIS. That order ensures you don't get a spurious high or low on the port.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…