case 0x02: //case 0x02 from firmware IDENT_PORT = 0X00; j = 0x16; // bit mask ie, & with 1111 0000 to clear bottom nibble upper_nibble = j & 0x0f0; // 0001 0110 PORTB = upper_nibble; // present upper nibble on port b RB1 = 1; // pulse enable line DelayUs(100); RB1 = 0; DelayUs(100); k = (j << 4) | (j >> 4); // swap upper and lower nibbles of 0x16 lower_nibble = k & 0x0f0; // again bit mask to leave the lower nibble (0110) PORTB = lower_nibble; // put on port RB1 = 1; DelayUs(100); // pulse enable line RB1 = 0; DelayUs(100); PORTB = 0x00; // clear port break;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)