Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:practical:hardware:sut:stm32:emb1a_1 [2024/03/03 09:22] – [Steps] ktokarzen:iot-open:practical:hardware:sut:stm32:emb1a_1 [2024/03/25 08:23] (current) – [Project information] pczekalski
Line 63: Line 63:
 To modify the fan's rotation speed after initialisation use the setCaptureCompare function. In the following example, the duty_cycle_value can vary between 0 and 100. To modify the fan's rotation speed after initialisation use the setCaptureCompare function. In the following example, the duty_cycle_value can vary between 0 and 100.
 <code c> <code c>
-MyFanServo->setCaptureCompare(channelFAN, duty_cycle_value, PERCENT_COMPARE_FORMAT); //modify duty cycle+MyTimFan->setCaptureCompare(channelFAN, duty_cycle_value, PERCENT_COMPARE_FORMAT); //modify duty cycle
 }; };
 </code> </code>
Line 80: Line 80:
 </code> </code>
 ==== Result validation ==== ==== Result validation ====
-You should be able to observe the pulsing colours of the RGB LED, increasing and decreasing brightness linearly.+You should be able to observe the changes in the fan's rotation speed. It is advisable to connect this scenario with the scenario for reading the pressure measurements.
  
 ===== FAQ ===== ===== FAQ =====
-**What is the maximum number of channels?**: the MCU we use here is STM32WB55 on the Nucleo board. The pins available are connected to timer 1 with three PWM channels (connected to our RGB LED) and timer 2 with 4 PWM channels (with two of them connected to the servo and fan described in other scenarios). A single timer can generate PWM signals with independent duty cycles and identical frequency.+**What is the maximum number of channels?**: the MCU we use here is STM32WB55 on the Nucleo board. The pins available are connected to timer 1 with three PWM channels (connected to RGB LED described in another scenario) and timer 2 with 4 PWM channels (with two of them connected to the servo and fan). A single timer can generate PWM signals with independent duty cycles and identical frequency.
 \\ \\
-**What is the maximum bit resolution for PWM?**: Maximum resolution is 16 bits. Note that we can express the duty cycle in a variety of formats. In the presented example we expressed it in percentage so it varies between 1 and 100. It can be also expressed in ticks, Hertz, microseconds, and 1-16 bits numbers.+**What is the maximum bit resolution for PWM?**: Maximum resolution is 16 bits. Note that we can express the duty cycle in a variety of formats. In the presented example we expressed it in percentage so it varies between 1 and 100. It can be also expressed in ticks, microseconds, and 1-16 bits numbers.
 \\ \\
-**What PWM frequency should I use?**: there is no straightforward answer to this question: assuming you observe LED remotely with a camera, even 50Hz would be enough. But it would give a severe flickering experience to the live user, on the other handIn the example abovewe propose 100Hz, but this MCU can easily handle higher frequencies.+**What PWM frequency should I use?**: It depends on the signal useFor the fan or LEDsno specific frequency is required, but for the servo, the frequency needs to be precisely 50Hz. If you use a servo and fan in the same project set the timer frequency at 50Hz.
  
 +<WRAP noprint>
 ===== Project information ===== ===== Project information =====
 {{:en:iot-open:logo_iot_200_px.png?200|}}\\ {{:en:iot-open:logo_iot_200_px.png?200|}}\\
Line 105: Line 106:
 {{:en:iot-open:ccbync.png?100|}} {{:en:iot-open:ccbync.png?100|}}
 </figure> </figure>
- +</WRAP>
- +
en/iot-open/practical/hardware/sut/stm32/emb1a_1.1709457778.txt.gz · Last modified: 2024/03/03 09:22 by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0