
Originally Posted by
plyrathrt
How to I put RA0,RA1,RA2,RA3, RB0,RB1, and RB3 as inputs?
RA 7 6 5 4 3 2 1 0
see bits below
Code:
TrisA =%00001111 ' RA 0:3 as inputs RA 4:7 as outputs in binary
OR
TrisA = $0F ' same thing in HEX
or
TrisA = 15 ' same thing in DECIMAL
TrisB = %00001011 ' PortB 0,1,3 as inputs
I like binary because it is easy to see at a glance, 1s are inputs, 0s are outputs
Edit: Doh!, Port calls hi / low status of output, TRIS register determines Input/Output
Last edited by Archangel; - 18th August 2008 at 00:55.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks