drjohsmith
- Joined Dec 13, 2021
- 1,609
Missed that.Having examined the problem more carefully, I have dropped the monostable solution and went with the long shift register in software.
Missed that.Having examined the problem more carefully, I have dropped the monostable solution and went with the long shift register in software.
You don't need a very long 533-bit shift register.
I see your two points, one saying we don’t need such a long 533-bit shift register, and another saying you already went with the long register in software.I have dropped the monostable solution and went with the long shift register in software.
the possible magic words areI see your two points, one saying we don’t need such a long 533-bit shift register, and another saying you already went with the long register in software.
if we really go with a long 533-bit shift register, how exactly would that be implemented? A normal integer variable only gives me 16 bits
declare an array of integers that can hold 533 bits. then write some code that uses it...if we really go with a long 533-bit shift register, how exactly would that be implemented? A normal integer variable only gives me 16 bits
int buffer[34] = {0}; // declare buffer array
bool shift_data(bool reject_sensed) {
bool wrap;
bool result;
for(int n=33; n>0;n--){
buffer[n]=buffer[n]>>1;
if(n>0)
wrap=(buffer[n-1] && 0x8000) != 0;
else
wrap = 0;
if (wrap) {
buffer[n]=buffer[n] || 0x8000;
}
}
if (reject_sensed) {
buffer[0]=buffer[0] || 0x8000;
}
return (buffer[34] && 0x0100) != 0; // bit 533
}