STM32F3 and STM32F4 SPI Problems.

STM32F3 and STM32F4 SPI Problems.
STM32

When porting one of my projects from the F1 series to the F3 series, I ran into a problem: SPI frames were always 16 bits long, but I needed 8. Interestingly, the F1 series has a single DFF (Data frame format) bit for setting the SPI frame length: when it is cleared the frame is 8 bits, when set, 16. In the F3 series a 4-bit field was allocated for this, and the frame length can...

Connecting an SD Card to a Microcontroller.

Connecting an SD Card to a Microcontroller.

In one of my previous articles we displayed an image from an SD card on a display, but a few points were left out: first, connecting the card itself; second, only some of the Petit FatFs library functions were covered. Let's look at these points in more detail. Communication with the card is possible over one of two interfaces, SPI or SD. I should say that the SD interface can work in one-bit...

SPI STM32.

SPI STM32.
STM32

We won't go over how the protocol works, since it was covered here; let's go straight to the capabilities of the STM32 SPI module: full-duplex synchronous transfer using 3 lines; simplex synchronous transfer using two lines, with the option of a bidirectional data line; 8- or 16-bit frame format; operation in Master or Slave mode; in Master mode 8...

Digital Programmable Oscillator: Connecting the LTC6903 to STM32.

Digital Programmable Oscillator: Connecting the LTC6903 to STM32.
STM32

In one of my designs I needed to vary a clock frequency over a wide range, and as the title suggests, I chose the LTC6903. The LTC6903 and LTC6904 are digital programmable oscillators with a frequency range from 1KHz to 68MHz; the only difference is that the LTC6903 is controlled via SPI and the LTC6904 via I2C. They are quite easy to connect and only require bypass capacitors on the supply...

SPI Protocol Basics.

SPI Protocol Basics.

SPI (Serial Peripheral Interface) is a serial peripheral communication protocol. It was developed by Motorola but is now used by many manufacturers. It is designed for communication between microcontrollers, as well as with all kinds of peripherals: sensors, ADCs, memory chips, clocks. But still, the most common use of SPI is writing a program into the memory...

How to Get Touch Point Coordinates and Calibrate a Resistive Touch Panel, Using the XPT2046 as an Example.

How to Get Touch Point Coordinates and Calibrate a Resistive Touch Panel, Using the XPT2046 as an Example.
Дисплеи

In the previous article we looked at how to initialize the controller; in this one we'll figure out how to get the touch coordinates and calibrate the touch panel. Before determining the touch coordinates, the touch itself has to be detected; for this we'll use the dedicated T_IRQ pin, which goes to logic zero when the panel is touched. It would be good to connect it to a pin responsible for...

How a Resistive Touch Screen Works, Using the XPT2046 Controller as an Example.

How a Resistive Touch Screen Works, Using the XPT2046 Controller as an Example.
Дисплеи

As you know, touch screens today come in 2 types: resistive and capacitive. Their main difference for the user is that a resistive screen responds to pressure, while a capacitive one responds to touch. Let's look at how each of them is built. A resistive screen is a glass liquid crystal display covered with a flexible membrane. On the facing...