Page 1 of 2

STM32 Delay I/O

Posted: Sun May 14, 2017 7:46 am
by volodymyr0604
Why I / O bus delays of 10 microseconds, when testing the SPI, data transmission with CLK is 25 mbits less than 100 kbits, the delay between bytes is 10 microseconds

Re: STM32 Delay I/O

Posted: Mon May 15, 2017 8:32 am
by LeighM
Hi,
Could you attach a program example of your issue?
Is your question just about the delay between sending bytes?

Re: STM32 Delay I/O

Posted: Tue May 16, 2017 7:00 am
by volodymyr0604
Hello, Benj.
The problem is in the ports of output input, I did the I2C program In flovkode 7.2.0.5, SCL at a CPU speed of 48 MHz 40 Kbps without.
SPI speed 8 mbps delay bytes 10 μsec, simple port output delay 10 μsec. The RTC element has a speed of 40 kbit, at the location indicated 400 kbit.

Re: STM32 Delay I/O

Posted: Tue May 16, 2017 9:15 am
by LeighM
IO is slower than it could be due to the fact that we have used the ST HAL.
I'll have a look at modifying the Flowcode IO CAL to speed things up.

Re: STM32 Delay I/O

Posted: Tue May 16, 2017 10:37 am
by LeighM
Hi,
Could you please try the attached replacements for the files in your Flowcode7\CAL\STARM directory?
Thanks
Leigh

Re: STM32 Delay I/O

Posted: Wed May 17, 2017 6:22 am
by volodymyr0604
Hi LeighM.
I've added the I2C program(FC v7.2.1.4) is connected, the port speed remains the same (50 kbits)
text data bss dec hex filename
27668 16 3240 30924 78cc ..Test(STM32F051C8T6).elf
Compilation successful
Iniciando el enlazador/ensamblador…
C:\Program Files (x86)\Flowcode 7\tools\DoNothing\DoNothing.exe
FINALIZADO
=================================================================
I've added new files, errors occur during compilation with te RTC (DS3231)

Device STM32F051x8
In file included from C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.c:38:0,
from C:\Program Files (x86)\Flowcode 7\CAL\includes.c:47,
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_Init_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
Test(STM32F051C8T6).c:252:27: note: in expansion of macro 'portg'
#define MX_I2C_SDA_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SDA_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:211:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SDA_PORT_X CAL_APPEND(MX_I2C_SDA_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:257:21: note: in expansion of macro 'MX_I2C_SDA_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SDA_PORT_X, MX_I2C_SDA_TRIS_X, MX_I2C_SDA_PIN_X); //Configure SDA as Input
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: note: each undeclared identifier is reported only once for each function it appears in
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
Test(STM32F051C8T6).c:252:27: note: in expansion of macro 'portg'
#define MX_I2C_SDA_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SDA_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:211:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SDA_PORT_X CAL_APPEND(MX_I2C_SDA_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:257:21: note: in expansion of macro 'MX_I2C_SDA_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SDA_PORT_X, MX_I2C_SDA_TRIS_X, MX_I2C_SDA_PIN_X); //Configure SDA as Input
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_Uninit_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
Test(STM32F051C8T6).c:252:27: note: in expansion of macro 'portg'
#define MX_I2C_SDA_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SDA_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:211:28: note: in expansion of macro
'CAL_APPEND'
#define MX_I2C_SDA_PORT_X CAL_APPEND(MX_I2C_SDA_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:281:21: note: in expansion of macro 'MX_I2C_SDA_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SDA_PORT_X, MX_I2C_SDA_TRIS_X, MX_I2C_SDA_PIN_X); //Configure SDA as Input
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_Start_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
Test(STM32F051C8T6).c:258:27: note: in expansion of macro 'portg'
#define MX_I2C_SCL_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SCL_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:214:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SCL_PORT_X CAL_APPEND(MX_I2C_SCL_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:293:21: note: in expansion of macro 'MX_I2C_SCL_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SCL_PORT_X, MX_I2C_SCL_TRIS_X, MX_I2C_SCL_PIN_X); //Make Sure SCL is Set
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_Restart_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
REGULADOR(STM32F051C8T6_SYSCLK(HSE)-53mHz)-14.c:252:27: note: in expansion of macro 'portg'
#define MX_I2C_SDA_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SDA_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:211:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SDA_PORT_X CAL_APPEND(MX_I2C_SDA_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:310:21: note: in expansion of macro 'MX_I2C_SDA_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SDA_PORT_X, MX_I2C_SDA_TRIS_X, MX_I2C_SDA_PIN_X); //Set SDA High
^
In file included from C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.c:38:0,
from C:\Program Files (x86)\Flowcode 7\CAL\includes.c:47,
from Test(STM32F051C8T6).c:1463:
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_Stop_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:46:47: note: in definition of macro 'FCP_SET_B'
#define FCP_SET_B(Port, Mask, Shift, Source) {Port->MODER = (Port->MODER & ~(3<<((Shift)*2))) | (1<<((Shift)*2)); Port->BSRR = 1 << (Shift + (Source?0:16));}
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:328:3: note: in expansion of macro 'FC_CAL_Bit_Low_DDR'
FC_CAL_Bit_Low_DDR(MX_I2C_SCL_PORT_X, MX_I2C_SCL_TRIS_X, MX_I2C_SCL_PIN_X); //Set SCL Low
^
Test(STM32F051C8T6).c:258:27: note: in expansion of macro 'portg'
#define MX_I2C_SCL_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SCL_PORT_1'
#define CAL_APD(a, b) a##b
^
C:
\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:214:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SCL_PORT_X CAL_APPEND(MX_I2C_SCL_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:328:22: note: in expansion of macro 'MX_I2C_SCL_PORT_X'
FC_CAL_Bit_Low_DDR(MX_I2C_SCL_PORT_X, MX_I2C_SCL_TRIS_X, MX_I2C_SCL_PIN_X); //Set SCL Low
^
In file included from C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.c:38:0,
from C:\Program Files (x86)\Flowcode 7\CAL\includes.c:47,
from Test(STM32F051C8T6).c:1463:
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_TxByte_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
Test(STM32F051C8T6).c:252:27: note: in expansion of macro 'portg'
#define MX_I2C_SDA_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SDA_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:211:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SDA_PORT_X CAL_APPEND(MX_I2C_SDA_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:355:23: note: in expansion of macro 'MX_I2C_SDA_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SDA_PORT_X, MX_I2C_SDA_TRIS_X, MX_I2C_SDA_PIN_X); //Set SDA High
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c: In function 'FC_CAL_I2C_Master_RxByte_1':
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:86:15: error: 'GPIOG' undeclared (first use in this function)
#define portg GPIOG
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_IO.h:136:68: note: in definition of macro 'FC_CAL_Bit_In_DDR'
#define FC_CAL_Bit_In_DDR(Port, Tris, Pin) (FC_CAL_Bit_In_DDR__x((Port), (Pin)))
^
Test(STM32F051C8T6).c:252:27: note: in expansion of macro 'portg'
#define MX_I2C_SDA_PORT_1 portg
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:65:26: note: in expansion of macro 'MX_I2C_SDA_PORT_1'
#define CAL_APD(a, b) a##b
^
C:\Program Files (x86)\Flowcode 7\CAL\internals.c:66:28: note: in expansion of macro 'CAL_APD'
#define CAL_APPEND(a, b) CAL_APD(a, b)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:211:28: note: in expansion of macro 'CAL_APPEND'
#define MX_I2C_SDA_PORT_X CAL_APPEND(MX_I2C_SDA_PORT_, MX_I2C_NUM)
^
C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_I2C.c:394:21: note: in expansion of macro 'MX_I2C_SDA_PORT_X'
FC_CAL_Bit_In_DDR(MX_I2C_SDA_PORT_X, MX_I2C_SDA_TRIS_X, MX_I2C_SDA_PIN_X); //Set SDA High
^
Error(s) in build

C:\Program Files (x86)\Flowcode 7\compilers\STARM\batch\stm32comp.bat notificado código de error 1

Re: STM32 Delay I/O

Posted: Wed May 17, 2017 8:31 am
by LeighM
Could you please attache your Flowcode program?
Using "Upload attachment"

EDIT:
OK, I can see the issue in your posting,
from the test filename it looks like you are using STM32F051C8,
and you are using PORTG, but this device does not have a PORTG.
You will need to change the connection properties for the DS3231

Re: STM32 Delay I/O

Posted: Wed May 17, 2017 9:37 pm
by volodymyr0604
Sorry, I was in a hurry and did not see the connection of the RTC (DS3231), PB6-SDA,PB7-SCL.
The ouput is good (125 kbits), after specifying the address for reading, there is no restart, reads 0xFF, the speed does not match, if you specify 400 kbit or 1 mbps, the real speed is 125 kbps.
The speed of the ports remained the same, the SPI2-HW speed was 12.5 Mbit, the delay between bytes was 10 microseconds.
My program for TFT-Touch without delay has a speed of 30 kbit, transmission and reception works well.
My program for I2C without delay has a speed of 50 kbit, transmission and reception works well.

STM32F051C8T6 ( 8MHz, HSI/2 * 12 = 48) I tried different HSE 8 MHz * 6 = 48, crystal HSE 26,6 MHz * 2=53.2.
The speed of the I / O ports is practically unchanged, and the delay between the bytes of the SPI port does not change, at different output speeds.

I do not know how to attach a file, tell me how to do it to send you.

Thanks for the quick answers.

Re: STM32 Delay I/O

Posted: Thu May 18, 2017 8:41 am
by LeighM
attach.jpg
attach.jpg (27.06 KiB) Viewed 18750 times

Re: STM32 Delay I/O

Posted: Thu May 18, 2017 8:13 pm
by volodymyr0604
Hi LeighM. I send my file the Test.
RTC does not remember port connection
Thank you.

Re: STM32 Delay I/O

Posted: Fri May 19, 2017 9:42 am
by LeighM
Hi

Thanks for your information. If I understand you correctly, your reported issues are:
1) SPI clock speed 12MHz
2) SPI delay between bytes of 10uS
3) RTC I2C speed is 125kbps even when faster selected
4) RTC does not remember port connections

My comments on these:
1) 12MHz SPI clock looks correct to me with a APB1 clock of 48MHz. For SPI1 you have the Prescaler property set to Fosc/16 and for SPI2 it is set to Fosc/4. The fastest setting is Fosc/2.
2) For the SPI peripheral code we interface to the ST HAL libraries. I have had a quick look and the 10uS delay does not look unreasonable to me for the amount of code that gets run.
3) and 4) There have been some recent updates to the RTC component regarding lost settings, I think this might explain both issues. Please could you replace the RTC component in your Flowcode components directory with the one attached, try it and see if that resolves the RTC issues.

Hope that helps and let me know if I have misunderstood or missed any issues.
Leigh

Re: STM32 Delay I/O

Posted: Fri May 19, 2017 5:21 pm
by volodymyr0604
Hi.
Thanks for the quick response. You have understood correctly.
STM32F051(52 MHz,SPI-12.5MHz) - TFT 2.4 320x240 clears the screen in 1.8 seconds. Atmega 2560 (16 MHz,SPI-8MHz)) clears the screen in 0.3-0.4 seconds.Cleaning program is the same.
Transmission over SPI is faster for TFT,Touch,SPI SRAM, Flash memory, SD. For this reason, I want delays of no more than 1μs when transferring data.
I have everything connected via SPI, and I need to transfer more data.

I checked the new RTC, Speed remained the same, does not remember the port.
Program is the same(10.004 bytes).I installed the NEW component of the RTC on May 14, 2017.

Re: STM32 Delay I/O

Posted: Fri May 19, 2017 7:25 pm
by LeighM
To improve the transfer rate the SPI will need to send more than one byte per transaction.
So that means you writing some code or we add to the component.
It would be a good feature for us to add, but being busy it might be a while.
Next week I will see if I can come up with a quick workaround.

Re: STM32 Delay I/O

Posted: Sat May 20, 2017 6:57 am
by volodymyr0604
Hi LeighM.
Thank you. I'll wait.
I read the use of HAL library and DMA.

Re: STM32 Delay I/O

Posted: Mon May 22, 2017 12:38 pm
by LeighM
Hi,
I've written a macro, attached, that should enable you to send an array of bytes to the SPI channel.
Import this macro into your project and create two byte arrays (strings) to hold the send and receive data.
It compiles OK, but I have not had chance to test on hardware, please give it a try and let me know how it goes.
Leigh

Re: STM32 Delay I/O

Posted: Thu May 25, 2017 9:11 am
by volodymyr0604
Hi LeighM.
Thank you.
I already tried through the string and through the Circular buffer, the same problem, the delay between the bytes is 10 us.
I watched STARM_CAL_Delay, there is a lines:
// With watchdog timer
#define FCI_DELAYBYTEWDT_S(count) Wdt_Delay_S((count))
#define FCI_DELAYBYTEWDT_MS(count) Wdt_Delay_Ms((count))
#define FCI_DELAYBYTEWDT_US(count) delay_us((count))
--------------------------------------
static inline void delay_10us(uint32_t __us10);
-------------------------------------
static inline void delay_10us(uint32_t __us10)
{
delay_us(__us10 * 10);
}
--------------------------------------
As I understand it, this is the minimum delay (10) mks.
Maybe this is the problem?

Re: STM32 Delay I/O

Posted: Thu May 25, 2017 9:28 am
by LeighM
The delay function only runs if you call it.
Even if you send a string, it will have been one byte at a time if you used the SPI component to send it.
Did you try the macro I sent you? This is designed to take the whole string and send it in one transaction.
Note that you still need to use the SPI component in your project and call its Initialise macro.
Then use the macro to send a buffer of data.

Re: STM32 Delay I/O

Posted: Thu May 25, 2017 6:35 pm
by volodymyr0604
Hi LeingM.
Thank you.
I checked the program, speed 3MHz-after 6 bytes does not output, speed without delay.
Speed 12.5MHz-after 4 bytes does not output.

Re: STM32 Delay I/O

Posted: Fri May 26, 2017 8:42 am
by LeighM
Hi
Could you try it again, but use allocated buffer space for the received data ...
buffer_variables.jpg
buffer_variables.jpg (18.61 KiB) Viewed 18490 times

Re: STM32 Delay I/O

Posted: Sat May 27, 2017 7:06 am
by volodymyr0604
Hi LeighM.
I checked.
At the beginning of the program, the CPU flushes if I connect the macro, after all the initialization the macro works (slightly changed).
It's unclear why there is still a delay in setting-0.

Re: STM32 Delay I/O

Posted: Sat May 27, 2017 11:59 am
by volodymyr0604
Hi LeighM.
Tried with DMA, does not work(slightly changed).

Re: STM32 Delay I/O

Posted: Sat May 27, 2017 1:35 pm
by LeighM
The delay is for the same reason as before, it is the time the code takes to setup the transaction.
You only have 2 bytes in each transaction.
Try loading up a larger buffer with data before sending it in a single transaction.

Re: STM32 Delay I/O

Posted: Sat May 27, 2017 8:39 pm
by volodymyr0604
With more bytes, the CPU is croaking, and there is nothing further.
Now some problems, the address of reading the font can not be calculated, reads from one address, the reading of the font chip is normal.
.char = 0х30
.font_Offset = 0х20
.num_bytes_letra = 0x20
.font_address = 0х8000
.Addr_Char = (((.char - .font_Offset) * .num_bytes_letra) + 4) + .font_address
.Addr_Char =(((0x30-0x20)*0x20)+4)+0x8000 = There must be an address = 0x8204, Reads start address = 0х8000
Before the modification read normally bytes of the font

Re: STM32 Delay I/O

Posted: Sun May 28, 2017 7:51 am
by volodymyr0604
Hi LeighM.
I saw that the simulation is proceeding normally, I tried it in a step-by-step mode,
after compilation problems arise when the program is running.
And there are problems with Flowcode v7.2.0.5
Hi Injector in the panel is, but in the console there.
With the simulation, in the step-by-step mode, the data in the console does not immediately appear.
Maybe this does not work properly with your macro SPI_Transaction.

Re: STM32 Delay I/O

Posted: Sun May 28, 2017 8:28 am
by volodymyr0604
Hi LeighM.
Reinstalled FC, HI injector appeared in the console, I will try further,
disappeared Circular Buffer.
Still, there are problems, the compiler message window is cleaned immediately after compilation.