Comments (4)
Thanks for the bug report. The bug has been fixed. I'd like a test (I don't have an L4 family chip).
from stm32_graphics_display_drivers.
This option doesn't work. Still not taken into account -1 (in L4 channel numbering from 1). The expressions in the original post were used for testing. The TX process works fine with them. But the RX process does not go at all, even without DMA. Duplex mode was used. Attached are oscillograms of the pixel reading subroutine execution:
`uint16_t ili9341_ReadPixel(uint16_t Xpos, uint16_t Ypos)
The first pair - signals SPI_SCK, SPI_MOSI for F4 (all Ok).
The second pair - signals SPI_SCK, SPI_MISO for F4 (all Ok).
On oscillograms:
- 2 bytes TX from LCD_IO_WriteCmd8MultipleData8();
- 10 bytes TX from ILI9341_SETCURSOR();
- 1 Byte TX + 1 Byte Dummy + 24 Bits RX + 8 Bits ?? from LCD_IO_ReadCmd8MultipleData24to16();
- 2 bytes TX from LCD_IO_WriteCmd8MultipleData8().
The third pair - signals SPI_SCK, SPI_MOSI for L4 - no reception clock. When the "software SPI driver" is set, clocking appears, but the data is not read correctly (this is the material for another topic).
I understand that you do not have the required processor, but if possible, try to find the reason for the incorrectness. You have a very specific approach to working with interfaces. By the way, it is not clear what it is for 8 cycles, following 24 reading cycles, during which the speed also changes.
from stm32_graphics_display_drivers.
For L4: SPI TX + DMA mode functions normally. Software SPI RX also works. The following inaccuracies were found in the "Hardware SPI RX" implementation:
- file lcd_io_spi.c, LcdDirRead() function, line 459: must be GPIOX_SET (LCD_SCK);
- in the same function, for LCD_SPI_MODE = 2, the SPI_CR1_RXONLY flag must be set, and in LcdDirWrite() - respectively, reset (by analogy with F4), in fact, half-duplex is used here and the flag is needed to continuously generate clock pulses;
- during initialization for duplex mode, configuration of the SPI_MISO pin was skipped.
SPI RX DMA does not work, I did not go into details, most likely there is also something with the RXONLY flag. The same flag is used in L0.
from stm32_graphics_display_drivers.
Version 2021.01.07 in SPI RX mode and LCD_SPI_MODE = 2 still requires correction. By analogy with the working version for F4, before switching to receive mode, it is necessary to clear the receive buffer. Also, a feature of L4 in comparison with F4 is that the interface must be stopped to generate clocks from the RXONLY flag.
Full view of the tested function:
inline void LcdDirRead(uint32_t d)
{
GPIOX_MODER(MODE_OUT, LCD_SCK);
while(d--)
{
GPIOX_CLR(LCD_SCK);
LCD_READ_DELAY;
GPIOX_SET(LCD_SCK);
}
GPIOX_MODER(MODE_ALTER, LCD_SCK);
while(SPIX->SR & SPI_SR_RXNE) d = SPIX->DR;
SPIX->CR1 &= ~SPI_CR1_SPE;
SPIX->CR1 = (SPIX->CR1 & ~SPI_CR1_BR) | (LCD_SPI_SPD_READ << SPI_CR1_BR_Pos) | SPI_CR1_RXONLY;
SPIX->CR1 |= SPI_CR1_SPE;
}
In any case, you should turn off the interface when switching to transmission, although it works without it.
inline void LcdDirWrite(void)
{
SPIX->CR1 &= ~SPI_CR1_SPE;
SPIX->CR1 = (SPIX->CR1 & ~(SPI_CR1_BR | SPI_CR1_RXONLY)) | (LCD_SPI_SPD_WRITE << SPI_CR1_BR_Pos);
SPIX->CR1 |= SPI_CR1_SPE;
}
The implementation of the RX DMA mode remains open. Although for displays this is not very relevant.
On this topic, SPI for SIM32L4 is closed.
from stm32_graphics_display_drivers.
Related Issues (20)
- ILI9341 3.2inch TFT with XPT2046 Problem HOT 6
- ILI9486 calibration problem HOT 3
- Help for XPT2046 on ILI9486(SPI mode) HOT 6
- Please add support for display SSD1963 HOT 1
- ILI9488 Hardware SPI not working (but software mode works) HOT 3
- What is the license for this repository? HOT 1
- ssd1289 Driver HOT 1
- ili9328 tft lcd Touch not working HOT 1
- ILI9488 coordinate not start from the left of the screen HOT 1
- FSMC changed RS line HOT 4
- SPFD5408/ILI932x HOT 1
- Touch xpt2046/ili9341 HOT 1
- Touch XPT2046 HOT 1
- how to draw a string on ILI9488 screen? HOT 1
- Calibration HOT 1
- Some define can not find out in std lib like SPI_SR_BSY_Pos SPI_SR_RXNE_Pos please teach me which file them included HOT 5
- STM32H7 HOT 1
- Calibration not work
- SPI Reading Codes not working
- ILI9488 gpio8 mirror issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stm32_graphics_display_drivers.