So, I'm having a hard time following your code there, based on what you're
explaining in English. We'll just chalk that up to you code your way, I
code mine, blah blah blah . . .
But what's bothering me is this bit of(condensed ) code:
while(1){
> if (clock == 1){ // Check for Start pulse on high clock cycle
> . . .
> }
> __delay_cycles(1000);
> __R30 = gpio; // Output appropriate clock and start pulses
>
> if (clock == 1){
> clock = 0;
> }
> else{
> clock = 1;
> }
> }
>
You have two independent checks of the same variable. This *may* work, but
is also a potential problem. I say "may" because I'm having a hard time
following what you're saying you're trying to accomplish in English versus
your code. I'm missing something. In order to fix this I would:
while(1){
if (clock == 1){ // Check for Start pulse on high clock cycle
clock = 0;
. . .
}
else{
clock = 1;
}
__delay_cycles(1000);
__R30 = gpio; // Output appropriate clock and start pulses
}
Another thing I'm having a hard time figuring out is why your clock state
is binary, pulse cycle seems to be tri-state. But I'm not convinced I need
to worry about that.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/CALHSORqUXs2g7N%2BBhjWk8bKadt09Pn0yZ0B0cb9_AzMj8ZLAVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.