Hi Ben
SD_Component: ESP32_SDMode (4Bit):
It's working perfect ESP32_SD Mode (4Bit) AppendIntAarayToFile.
SD_Component:File SD/SDHC
So I tested the "normal SD-component" as well. Something is not working properly there.
One part of the integer is always dec 61 an "a"
Testet with the same macro but alway an "a":
ESP32 _ESP32_SDMode (4Bit) OpenFile return
-
- Valued Contributor
- Posts: 763
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
-
- Matrix Staff
- Posts: 1760
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 447 times
- Been thanked: 607 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
This one is odd, I can't see anything obviously wrong and I exported and imported the macro for the SD mode component so it's very odd. Please can you just double check your array your passing in is a INT type array.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
Hi Ben
Yes This one is odd.
Variable a have used: Command a have used: I get the same as yesterday
so I made a new test and used Byte Array, Int Array and Long Aarray
Also I reduced to 16 numbers so it' easy to read in the file later
I open it with a HEX editor, a very practical tool
Result Byte Array is ok, Int Array and Long Array has a little problem:
:
Yes This one is odd.
Variable a have used: Command a have used: I get the same as yesterday
so I made a new test and used Byte Array, Int Array and Long Aarray
Also I reduced to 16 numbers so it' easy to read in the file later
I open it with a HEX editor, a very practical tool
Result Byte Array is ok, Int Array and Long Array has a little problem:
:
-
- Matrix Staff
- Posts: 1760
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 447 times
- Been thanked: 607 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
Many thanks for that, it helped.
I've found the problem, I'm using the type conversion to get the bytes but this is then being used again inside the append byte and so the value gets corrupted.
I've put a new version on the library updates for you now that should solve the problem by reloading the type conversion INT/LONG/FLOAT value before getting each byte.
I've found the problem, I'm using the type conversion to get the bytes but this is then being used again inside the append byte and so the value gets corrupted.
I've put a new version on the library updates for you now that should solve the problem by reloading the type conversion INT/LONG/FLOAT value before getting each byte.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
Hi Ben
Perfect! It's working fine.
Now I just have one small problem left, with this hardware. I have already written a post that something is wrong with the SPI clock. Display and SD-Card are on the same Spi- Bus and I have to set the clock to the slowest clock from the SD-Card initial. That makes it slow. With the FC9 it was different. There the clock setting worked. Can you do something about it.
I suspect set sd initial clock no longer works
https://flowcode.co.uk/forums/viewtopic ... 9&start=10
Test with Arrays is perfect!:
Perfect! It's working fine.
Now I just have one small problem left, with this hardware. I have already written a post that something is wrong with the SPI clock. Display and SD-Card are on the same Spi- Bus and I have to set the clock to the slowest clock from the SD-Card initial. That makes it slow. With the FC9 it was different. There the clock setting worked. Can you do something about it.
I suspect set sd initial clock no longer works
https://flowcode.co.uk/forums/viewtopic ... 9&start=10
Test with Arrays is perfect!:
-
- Matrix Staff
- Posts: 1760
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 447 times
- Been thanked: 607 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
As for your SPI speed issue the difference between v9 and v10 could just be the order of the components in the project. There was a change for v10 which meant that shared peripherals like the SPI now only produce one set of code instead of having two or more sets of code that essentially did the same thing and controlled the same registers.
I assume that the order of things at the moment looks like this.
Display starts up and sets the base SPI rate.
SD Card initialises and the initial speed setting appears to be being ignored. I'll look into this.
High speed mode kicks in and the SPI rate is altered.
Please could you try Display - 5MHz, Initial - 5MHz and High speed 10MHz. This should startup the display and the SD card at the correct low speed and then the SPI clock should jump to 10MHz for everything. If this works then you can try increasing the high speed setting further.
I assume that the order of things at the moment looks like this.
Display starts up and sets the base SPI rate.
SD Card initialises and the initial speed setting appears to be being ignored. I'll look into this.
High speed mode kicks in and the SPI rate is altered.
Please could you try Display - 5MHz, Initial - 5MHz and High speed 10MHz. This should startup the display and the SD card at the correct low speed and then the SPI clock should jump to 10MHz for everything. If this works then you can try increasing the high speed setting further.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1760
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 447 times
- Been thanked: 607 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
Aha right the SD initial rate in v10 was being ignored if the SPI channel was already initialised by something else e.g. the display.
So I've hopefully solved this now in the latest version and the low speed mode should be imposed.
So this will now happen.
Display starts up and sets the SPI clock to the display setting.
SD card initialises and sets the SPI clock to the initial speed.
If SD card init is ok then SPI clock will be increases to the high speed setting. The display and SD operations will now operate at this high speed setting.
You can now try this.
Display - 10MHz, Initial - 5MHz and High speed 10MHz, if this works ok then you can increase the Display and High Speed settings.
So I've hopefully solved this now in the latest version and the low speed mode should be imposed.
So this will now happen.
Display starts up and sets the SPI clock to the display setting.
SD card initialises and sets the SPI clock to the initial speed.
If SD card init is ok then SPI clock will be increases to the high speed setting. The display and SD operations will now operate at this high speed setting.
You can now try this.
Display - 10MHz, Initial - 5MHz and High speed 10MHz, if this works ok then you can increase the Display and High Speed settings.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
Hi Ben
Yes the display is working with 32Mhz (with 35Mhz not anymore) so I set to 30Mhz.
That's great! The card still init.
If i set the Initial 1Mhz and Highspeed to 8Mhz, the card init is ok.
But if I set Initial 1Mhz and Highspeed to 10Mhz the cards does not init anymore.
Actually I'm only testing whether the card is init or not.
I have not read or written data.
Maybe the hispeedmode switches not correct? too early?
This is just an idea.
Card does not init:
How I test: In a loop 10x with a delay of 500mSec to init the card. No data to read/write
Yes the display is working with 32Mhz (with 35Mhz not anymore) so I set to 30Mhz.
That's great! The card still init.
If i set the Initial 1Mhz and Highspeed to 8Mhz, the card init is ok.
But if I set Initial 1Mhz and Highspeed to 10Mhz the cards does not init anymore.
Actually I'm only testing whether the card is init or not.
I have not read or written data.
Maybe the hispeedmode switches not correct? too early?
This is just an idea.
Card does not init:
How I test: In a loop 10x with a delay of 500mSec to init the card. No data to read/write
- Attachments
-
- Snag_669bae5.png (46.8 KiB) Viewed 583 times
-
- Matrix Staff
- Posts: 1760
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 447 times
- Been thanked: 607 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
8MHz seems to be a bit slow but could potentially be down to the SD card you're using or maybe the wiring to the card if you're using flying leads. I've happily had 20MHz + working on a custom PCB.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 763
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 151 times
- Been thanked: 171 times
Re: ESP32 _ESP32_SDMode (4Bit) OpenFile return
Hi Ben
The card is working in ESP32_SD_Mode 4Bit perfect with the maximal speed I can choose 40Mhz .
So this is a very good solution with Flowcode.
The same type of card is working in my hardware with a PIC32MZ on 50Mhz.
I'm recording a lot and most time 8 hours nonstop.
This is a very stable and reliable solution with Flowcode
I don't know why I have problems with this board, card and ESP32.
It is a purchased hardware in a case.
From 8Mhz to 20Mhz or 40Mhz would be good,
but it's not that bad. A doubling of the clock frequency does not necessarily mean a doubling of the write speed.
One small remark. The PIC32MZ also has a Quad Serial Peripheral Interface (QSPI)
Perhaps there will also be a component in the future.
The card is working in ESP32_SD_Mode 4Bit perfect with the maximal speed I can choose 40Mhz .
So this is a very good solution with Flowcode.
The same type of card is working in my hardware with a PIC32MZ on 50Mhz.
I'm recording a lot and most time 8 hours nonstop.
This is a very stable and reliable solution with Flowcode
I don't know why I have problems with this board, card and ESP32.
It is a purchased hardware in a case.
From 8Mhz to 20Mhz or 40Mhz would be good,
but it's not that bad. A doubling of the clock frequency does not necessarily mean a doubling of the write speed.
One small remark. The PIC32MZ also has a Quad Serial Peripheral Interface (QSPI)
Perhaps there will also be a component in the future.