2142 views|2 replies

94

Posts

4

Resources
The OP
 

STEVAL-MKI109V3 FSM Experience Analysis [Copy link]

 

In the past week, I have become familiar with the various functions of STEVAL-MKI109V3, and have a general idea of the idea and a simple outline of the implementation method. In the past two days, I have read a lot of relevant information, watched the relevant sharing of netizens, and conducted a simple debugging of the basic functions of FSM.

1. The official development board firmware is a bin executable file, which is not open source. Its purpose is to allow us to quickly generate sensor configurations and configure and debug FSM. Therefore, to achieve creative development, you need to use unico to configure the registers, export the .h file and import it into your personal project, and directly write the sensor's FSM-related registers through the bus.

Then further logic processing is implemented in the F401 MCU.

I have a question about understanding interrupts. Are the so-called INT1 and INT2 of FSM output by sensors? Is it through IO interrupt or soft interrupt? How does the main MCU get this interrupt?

2. After a brief study of FSM, I simulated the actual operation and made the simplest logic. I collected the data of the X+ axis, then judged the threshold of the data, and then counted it. When the continuous data meets the counting requirements, the output interrupt is output. The FSM logic is as follows:

By observing the interrupt, we can find that as long as the translation motion triggers the threshold, an interrupt will be generated. (Because the threshold and time count are set relatively small, the trigger is very sensitive)

3. Further, adjust the threshold (increase the trigger difficulty) and sampling time (increase the duration) to reduce sensitivity. The configuration is as follows:

The interrupt is triggered as follows:

This makes it more difficult to trigger, and there will be no false triggering.

4. To summarize briefly: Unico is very convenient to configure the FSM function. We can also quickly realize the action acquisition we want, and then write it into the MCU for development. I will spend the rest of this week to build the debugging environment. I have to reconfigure the previous environment after changing the computer, and I still have a lot of understanding of the development board. I will read the document carefully. I only have one day off this week, and the next sharing will probably be on May Day . Time is still very tight. I hope to see more sharing from forum friends.

image.png (259.42 KB, downloads: 0)

image.png

Latest reply

Well, your analysis is correct. Chapter 4 of the document AN5273 specifically discusses the issue of FSM interrupts. An interrupt is generated when the FSM reaches an end state or executes an OUTC/CONT/CONTREL command. The interrupt will be stored in the interrupt status register address of the corresponding state machine module, which can be regarded as a soft interrupt from the perspective of master-slave device interaction. By setting the INT1_FSM[1:16] and INT2_FSM[1:16] bits in the external interrupt INT configuration register, the external interrupt INT1/2 can be routed to the soft interrupt, thereby generating a hard interrupt.   Details Published on 2020-4-26 10:27
 
 

94

Posts

4

Resources
2
 

ADD:

If you want to modify the input source, you can do so by changing the input source configuration. For example, if you apply the above operation to the x+ axis of the gyroscope, the configuration is as follows:

The generated interrupt signal is determined by the gyroscope signal:

Since each FSM can be mapped to INT1 and INT2, I think the generated interrupt must be a soft interrupt, which is read through the register and then processed by the MCU program and mapped to the hardware IO interrupt. Welcome to communicate.

 
 
 

124

Posts

1

Resources
3
 

Well, your analysis is correct. Chapter 4 of the document AN5273 specifically discusses the issue of FSM interrupts.

An interrupt is generated when the FSM reaches an end state or executes an OUTC/CONT/CONTREL command.

The interrupt will be stored in the interrupt status register address of the corresponding state machine module, which can be regarded as a soft interrupt from the perspective of master-slave device interaction.

By setting the INT1_FSM[1:16] and INT2_FSM[1:16] bits in the external interrupt INT configuration register, the external interrupt INT1/2 can be routed to the soft interrupt, thereby generating a hard interrupt.

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list