PDA

View Full Version : Reading ports??



Arynock
09-05-2008, 01:21 PM
Okay, so i'm trying to read a 8bit databus with my basic stamp....

the only thing is... how can i read pins8-15 and store it into a variable in binary?

i know how to read pins individually, but i want to be able to read a whole port....

any help would be greatly appreciated..

Mike Green
09-05-2008, 01:35 PM
In the section of the manual on memory allocation, there's a discussion of the I/O registers OUTS, INS, DIRS which are 16 bit variables that represent all 16 I/O pins as outputs, inputs, and direction settings. These registers are all divided into bytes, nibbles, and individual bits and all of these have names. Input bits 8-15 are also named INH and that can be stored into any variable as an 8-bit value.