Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[STM32] Understanding of FSMC

Status
Not open for further replies.

Fever

Junior Member level 1
Joined
Apr 25, 2018
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
176
Hello,

I am using an STM32L496ZG, and 1MB of SRAM (this one : **broken link removed**)

My first idea was to use it with GPIO registers to control it. Like using GPIO_ODT to write the address I want to write to, and ODT again to write the data at this place.

I guess for SRAM it is a very slow way to do things, since I have to do everything manually.
I also guess that, to write 1 byte to the SRAM, I have to do two steps. Write the address, then write the data. It seems very inefficient to me.

I read about FSMC on STM32 devices, and I'm a bit intrigued. The reference manual explains how to use it well, but does not really explain what is it good for.
I saw on internet that a lot of people uses it for SRAM, FLASH, TFT ect, and I wanted to know if it is a good idea for me to use it.

How does it help to use FSMC ? Is it more efficient than using GPIOs as described before ? If so, why ?

Thank you very much for your help
 

FSMC implements a memory mapped interface, you'll access any memory location the same way as internal memory. I presume, you know how this works programmatically, so you'll know why it's more effective than using GPIO.
 

I guess I understand.

Having a given memory location (e.g 0x6000) means that I can write code like :

(*(char *)0x6000) = 'H';
(*(char *)0x6001) = 'i';
(*(char *)0x6002) = '!';

(this is just an example, I wouldn't code it like that)

So if I understand it correctly, it means that FSMC cares about chip select, OE, WE etc etc on the hardware directly. So no need to drive all the commands manually, saving quite a lot of instructions I guess.

Am I right ?

If so, how does the MCU knows that from the address 0x6000 it has to use FSMC rather than embedded SRAM from the MCU ?

Thanks
 

FSMC has individual memory range for each chip select, review the FSMC chapter in ST32 reference manual.

Rather than accessing individual bytes, you'll usually assign complete C structures or arrays at external memory range.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top