Send 10 bits of data via paralel interface


hi,

i trying send 10 bit of data external microcontroller using parallel interface.
this means using 1 digital pin every bit of data.

i know on atmel portc = xxxxxxxx 8 bit value, have 2 questions now:

first have set 2 output ports, port b , port c , place parts of result on each port.
second, suppose on port b using 2 pins else.

how assign each of individual bits particular output pin?

for example:

i read 10 bits adc. how select port send each of them?

thanks

if save value adc in int variable can use combination of shifting , masking identify each bit

for example

code: [select]
adcvalue = analogread(a0);
int tempval = adcvalue;
for (byte n = 0; n < 10; n++) {
    int bitval = tempval & 0b0000000000000001;  // rightmost bit hidden
     // bitval
    tempval = tempval >> 1; // move 1 bit right
}


...r


Arduino Forum > Using Arduino > Programming Questions > Send 10 bits of data via paralel interface


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support