Quote Originally Posted by LEDave View Post
Hi Joe

Very impressed with the two programs you posted, thanks for those and very clever. The coding in parts is way beyond me at present but the effect on my PIC1 board are great and shows what can be done.

I'll try and do the sequence mackrackit suggested today (time permitting).

"So now try to do the sequence LEDs 1-3 using HIGH/LOW."

It sounds straight forward enough (ish) but I've just got a feeling.......!

Dave
Hi Dave,
Really simple and not beyond where you are right now.
Tris is short for TriState. 3 states: in / output H / output L
Port determines if the tristate is high or low.
"Most" of the 12F , 8 pin devices use GPIO as Port name, it stands for General Purpose Input output. the TRIS is TRISIO. Here is the really simple part the letter" I " (for input) looks like a number 1 and the letter" O" (for Output) looks like a 0. so you see GPIO%00000011 means the 2 lowest bits are "set" as inputs. All the other bits are " cleared ". and are Outputs.
The Port register is done in a similar way. 1 is logic HIGH and 0 is logic LOW. Logic high is +5v and Logic Low is 0 volts.
I get that you might know this, but the next newbie may not. No offense intended.
Consider this statement:
TRISIO = %11111001
GPIO = %00000010 'LED 7 ON

TRISIO = %11111001 makes ports 1:2 into outputs
GPIO = %00000010 makes Port 1 Logic high and port 2 logic low.
Pay attention to the terminology "set" & "cleared" as you will see them in the data sheets.
Generally speaking you will set the Port first then the tris, if you have a circuit like this where you have a bidirectional load, you might consider making all tris as inputs, set your port and then set the tris to enable the outputs. Your loads might be something very different than LEDs.