defragster
Senior Member+
Just as a note I did populate the pullups.
#36 is CLK on SD - that seems wrong for SDIO use. Would be okay for SPI2 CS2.
Just as a note I did populate the pullups.
Adding flux or solder to heat both ends at once from the side … it might push or lift offWas thinking about removing it tomorrow if I can get it off
FASTRUN void sdioTestFreq( uint32_t cnt) {
int ii, nn;
for ( ii = 0; ii < 6; ii++ ) {
nn = 1 + ii;
analogWriteFrequency( pinsSDIO[ii], nn * 200 );
analogWrite( pinsSDIO[ii], nn * 32 );
}
while(1);
}
[ATTACH]17629._xfImport[/ATTACH]
Found Paul's freq change T4_Beta post #2443 updated for 1062 in FAST IO mode. Included here in updated code with a mod - when xx=2 at file top. Two other modes noted in code, xx=0 is the initial and xx=1 is the above p#203 shows voltage change:
Oddly Paul's code shows same volts on 5 of 6 pins - it reads 0.7V higher on my pin #36 ???
Code:[ATTACH]17629[/ATTACH]
34 - 1.85-1.9
35 - 3.73
36 - 7.48
37 - 14.98
38 - 3.73
39 - 1.857-1.9
@...
Using Paul's freq sketch in the referenced post I am getting these values (kHz)
Code:34 - 1.85-1.9 35 - 3.73 36 - 7.48 37 - 14.98 38 - 3.73 39 - 1.857-1.9
not sure what that means
@firehopper - thanks.
@defragster. Strange just can't figure out why it doesn't work when it should unless its the sd card socket itself?
So far I haven't gotten my t4 to read SD cards. Using the updated sdfat for t4. The same program reads the SD card I tried on the t4 on a t3.6 all my SD pins seem to work on the t4 breakout, is there something wrong with the layout maybe? I don't have the t4 mounted yet only have the flex in the socket. Waiting for the low profile headers to mount it. Don't think that's it but it might be.
static void SDHC_InitGPIO(void)
{
IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_04 = 0; //DAT2
IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_05 = 0; //DAT3
IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_00 = 0; //CMD
//3.3V
IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_01 = 0; //CLK
//GND
IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_02 = 0; //DAT0
IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_03 = 0; //DAT1
[COLOR="#FF0000"]const uint32_t CLOCK_MASK = IOMUXC_SW_PAD_CTL_PAD_PKE |
IOMUXC_SW_PAD_CTL_PAD_DSE(1) |
IOMUXC_SW_PAD_CTL_PAD_SPEED(2);[/COLOR]
const uint32_t DATA_MASK = CLOCK_MASK |
(IOMUXC_SW_PAD_CTL_PAD_PUE | IOMUXC_SW_PAD_CTL_PAD_PUS(1));
IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_04 = DATA_MASK;
IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_05 = DATA_MASK;
IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_00 = DATA_MASK;
IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_01 = CLOCK_MASK;
IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_02 = DATA_MASK;
IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_03 = DATA_MASK;
}
@mjs513 - As mentioned previously my SDCard/USB connection is toast, so I am not much help here...
If mine was at the stage yours is? I would plug in either the Sparkfun microsd sniffer (https://www.sparkfun.com/products/9419) or one of the similar ones I made for T3.6 testing and again check the IO pins...
Then If I were real brave, I wonder if maybe the IO pins associated with the SD are too long or the like to work with how they are configured.
That is if you look at NXP_SDHC.cpp for SDHC_InitGPIO (line 833)
You see maybe Drive Strength of 1 What happens if you try changing this to higher DSE?Code:static void SDHC_InitGPIO(void) { IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_04 = 0; //DAT2 IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_05 = 0; //DAT3 IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_00 = 0; //CMD //3.3V IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_01 = 0; //CLK //GND IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_02 = 0; //DAT0 IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_03 = 0; //DAT1 [COLOR="#FF0000"]const uint32_t CLOCK_MASK = IOMUXC_SW_PAD_CTL_PAD_PKE | IOMUXC_SW_PAD_CTL_PAD_DSE(1) | IOMUXC_SW_PAD_CTL_PAD_SPEED(2);[/COLOR] const uint32_t DATA_MASK = CLOCK_MASK | (IOMUXC_SW_PAD_CTL_PAD_PUE | IOMUXC_SW_PAD_CTL_PAD_PUS(1)); IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_04 = DATA_MASK; IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_05 = DATA_MASK; IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_00 = DATA_MASK; IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_01 = CLOCK_MASK; IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_02 = DATA_MASK; IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_03 = DATA_MASK; }
const int chipSelect = 36;
void setup()
{
//UNCOMMENT THESE TWO LINES FOR TEENSY AUDIO BOARD:
SPI.setMOSI(35); // Audio shield has MOSI on pin 7
SPI.setSCK(37); // Audio shield has SCK on pin 14
SPI.setMISO(34);
@KurtE
Tried changing both DSE and Speed but no luck. Now I just tried attaching a SD Card reader to SPI2 and defined connections in SD Cardinfo as:
No luck with SPI2 either. (those pins did ring out using BlinkAnyPin. As a test I hooked it up to SPI (10,11,12,13) and it worked fine.Code:const int chipSelect = 36; void setup() { //UNCOMMENT THESE TWO LINES FOR TEENSY AUDIO BOARD: SPI.setMOSI(35); // Audio shield has MOSI on pin 7 SPI.setSCK(37); // Audio shield has SCK on pin 14 SPI.setMISO(34);
EDIT: Put LA on 34-36: only pin that work was 36(CS) all other pins stayed high (no sd card attached).
@mjs513 I confirmed that my current stuff works for an ST7789 display hanging off of the last T4 beta board is working ...
That won't work on SPI! It needs to be SPI2...
Note: the SPI2.setMosi and like don't do much of anything as we only have one pin defined for each of these...
But I assume somewhere you tried SPI2.begin(), along with SPI2.beginTransaction(....)
As SPI2.transfer(0); for example without doing beginTransaction will fail (unless you grab my later stuff).
EDIT: also as a sanity test, have you tried running the same with one of the T4 beta breakout boards? I know I had a display running earlier on SPI2 off of the Sparkfun adapter...
… onehorse alternate store for Tlera and found this that has caps on 4 data wire SPI - but on data and CLK lines in schematic image: tindie.com/products/tleracorp/sdio-card-reader-for-dragonfly/
That won't work on SPI! It needs to be SPI2...
Note: the SPI2.setMosi and like don't do much of anything as we only have one pin defined for each of these...
But I assume somewhere you tried SPI2.begin(), along with SPI2.beginTransaction(....)
As SPI2.transfer(0); for example without doing beginTransaction will fail (unless you grab my later stuff).
EDIT: also as a sanity test, have you tried running the same with one of the T4 beta breakout boards? I know I had a display running earlier on SPI2 off of the Sparkfun adapter...
void loop() {
// put your main code here, to run repeatedly:
SPI2.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0));
digitalWrite(36,LOW);
SPI2.transfer(0);
SPI2.transfer(0);
digitalWrite(36,HIGH);
SPI2.endTransaction();
delay(1);
}