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.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top