| ??? 10/08/06 10:38 Read: times |
#126006 - I'm not sure Responding to: ???'s previous message |
but I think you mean to shift out a byte on an I/O ?
void send_char (void) { unsigned char n; for (n=0; n<8; n++) //send 8 BIT { if (dsp_char_out & (0x80 >> n)) // MSB first { _DATA |= 0x01; // HIGH Level @ IO } else { _DATA &= ~0x01; // LOW Level @ IO } shift_clock(); // generate a high to low transition } } A Byte in dsp_char_out will be shifted out MSB first. If you need LSB first try: if (dsp_char_out & (0x01 << n)) Is that what you are looking for ?? |
| Topic | Author | Date |
| shift register in C | 01/01/70 00:00 | |
| bdata? | 01/01/70 00:00 | |
| I'm not sure | 01/01/70 00:00 | |
| ah well,all sorted now | 01/01/70 00:00 | |
Try this | 01/01/70 00:00 |



