defragster
Senior Member+
I added a short header to the breakout - rushing I put it on the bottom instead of the top as intended - opps.
But it works I wired 34,35,36 in sequence jumpered to 37,38,39.
So this code should be alternating the first three between IN/OUTput and the opposite for the second three, then writes either 1 or 0 over time and expects to read the same back.
The code is not only showing FAILURES writing 1's both ways and not getting them - even with the delaymicroseconds between write/read, but the Teensy Restarts on occasion.
I'm not sure the code is doing everything right - it is in the other TempMon sample and being called too fast in batches.
I need to check the pins again …
But it works I wired 34,35,36 in sequence jumpered to 37,38,39.
So this code should be alternating the first three between IN/OUTput and the opposite for the second three, then writes either 1 or 0 over time and expects to read the same back.
The code is not only showing FAILURES writing 1's both ways and not getting them - even with the delaymicroseconds between write/read, but the Teensy Restarts on occasion.
I'm not sure the code is doing everything right - it is in the other TempMon sample and being called too fast in batches.
I need to check the pins again …
Code:
uint32_t pinsSDIO[9] = { 34, 35, 36, 37, 38, 39, 34, 35, 36 };
void sdioTest( uint32_t cnt) {
int ii, mm;
if ( cnt % 2 ) mm = 0;
else mm = 3;
for ( ii = mm; ii < mm + 3; ii++ ) {
pinMode( pinsSDIO[ii], OUTPUT);
pinMode( pinsSDIO[ii + 3], INPUT);
}
for ( ii = mm; ii < mm + 3; ii++ ) {
digitalWriteFast( pinsSDIO[ii], (cnt % 4) / 2 );
delayMicroseconds( 4);
if ( (cnt % 2) / 2 != digitalReadFast( pinsSDIO[ii + 3] ) ) {
digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
Serial.print('-');
Serial.print((char)('A'+ii));
Serial.print(cnt % 2);
Serial.println((cnt % 4) / 2);
delayMicroseconds( 400 );
}
//else Serial.print('+');
}
}