Hi There,
I'm to this forum so I'd first like to say hi to all you people out there. My question seems rather trivial but I can't seem to figure it out. Basically I have a 16 bit bus which is scattered through PortA, B, and C on an 16F877A. I would like to define the 16 bit data and have each bit of the data automatically associated with the PortX.Y like so
BUS_DATA var word
BUS_DATA.0 = PortA.0
..etc
The problem is that I can't get it to work and had to do the following routine:
If BUS_DATA=1 then
PortA.0 = 1
Else
PortA.0 = 0
Endif
...etc
This is rather lengthy and eats lots of space. I've done it before were I define a byte like MY_INFO var PortE.0 but that's an entity on it's own. I can't seem to associate data bits with port bits.
Can anybody help me out?
Many thanks,
Osiris
Bookmarks