PDA

View Full Version : Aliasing a port with arbitrary I/O pins?



Jayhovah
- 18th May 2008, 22:16
I am using a 16F676 which has only two 6bit ports.
I would like to have an 8bit port, but I am unable to Alias one.

I am trying to do something like:

OUTPORT.0 = PORTA.0
OUTPORT.1 = PORTC.0

but I will get compilation errors. I am using Microcode Studio.

Is there anyway to get an 8bit alias that represents 8 I/O pins so that I can do something like:

OUTPORT = %11101101

Any ideas? Or will I just have to make a byte variable and create a routine to assign its values to output pins (and then run it every time I change the variable)?

sayzer
- 19th May 2008, 08:28
Here is the answer.

http://www.picbasic.co.uk/forum/showthread.php?t=3753

Jayhovah
- 19th May 2008, 15:09
So the short version, for anyone who finds this thread on a search, is that I do indeed have to just create a routine to assign the outputs.

However, if you follow the link provided by Sayzer, you can find some simple and efficient routines to accomplish it.

Thanks Sayzer!