• 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.

small question about pic assembly

Status
Not open for further replies.

wejos

Member
this is 16f84, and according to what i've read, port A is 5 bit.

why in this code and i found in many examples as well, they used 8 bit to set port A;s input and output? am i missing something here?

start movlw b'00000001'
tris PORTA
movlw b'00000000'
tris PORTB




thank you in advance
 

Papabravo

Well-Known Member
Even if the bits #5, 6, and 7 do not go outside the chip they are still on the data bus. If thery have nowhere to go at the end of the write cycle they just fall off the edge of the Earth so to speak. There is no real problem that I can see.
 
Last edited:

be80be

Well-Known Member
I think it more like habit and a good one to keep Like the 12f683 only 6 pin for I/O and
you can set it b'000000 or B'00000000 both work same with any chip it reads from right to left so any past the 5 it uses. Get a 0 any way. And if you get in the habit of not
using 8 when you use a Port with 8 you'll do it wrong a time or to. I always use 8
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top