Naming I/Os in SX/B
When defining the I/O pins in SX/B, can you name an arbitrary·group of pins? For example, could I name pins RC4 through RC 6 as a variable? I would like to be able to easily output a three bit number to a group of pins.
The structure I am referring to is something like:
··· name ·VAR· ·RC
except I would like to replace "RC" with a group of pins
I appreciate any help. I am new to the SX.
The structure I am referring to is something like:
··· name ·VAR· ·RC
except I would like to replace "RC" with a group of pins
I appreciate any help. I am new to the SX.
Comments
· You can only name individual pins (RC.0) or the whole port (RC).
· To do three pin you would use "OR" and "AND" to set or clear the bits as needed:
· temp = value << 4················ ·'·Get bits in position
· temp = temp OR %1000_1111 · ' Create AND mask
· RC = RC AND temp·············· ·· ' Clear bits that are zero
· temp = temp AND %0111_0000 ' Create OR mask
· RC = RC·OR temp··················· ' Set bits that are one
· It might make more sense to just do:
· RC.4 = value.0
· RC.5 = value.1
· RC.6 = value.2
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
Post Edited (Bean (Hitt Consulting)) : 2/12/2007 5:28:36 PM GMT