Search found 161 matches

by Ollie
Thu Jun 22, 2017 10:33 am
Forum: General discussion
Topic: Problem with measuring very short pulses
Replies: 29
Views: 794

Re: Problem with measuring very short pulses

The easiest way is to use the continuously running debug counter. It gives the time at clock resolution, such as 72 MHz. You need to first enable the counter, then read the count at the beginning and then at the end.
by Ollie
Fri Jun 16, 2017 8:57 am
Forum: Code snipplets
Topic: GPIO registers and port manipulation
Replies: 13
Views: 4131

Re: GPIO registers and port manipulation

If your application is using interrupts that could manipulate the target GPIO ports, the read-modify-write operation is not safe. That is the reason, why STM has designed BSRR registers to set and reset selected pins. The monotonic pin manipulations can be done with macros #define gpio_clear(GpioPor...
by Ollie
Sat Jun 10, 2017 3:45 pm
Forum: Welcome & FAQs
Topic: STM32 MCUs and the right pick
Replies: 19
Views: 628

Re: STM32 MCUs and the right pick

@Dannyf, The trick in calculating the speed in every edge is to store all the previous edges around the full turn. At minimum, there are 4 edges that are not evenly distributed due to differences in hall sensor mounting: - rising A - falling A - rising B - falling B In addition of that, the rotating...
by Ollie
Wed Jun 07, 2017 2:09 pm
Forum: STM32F4 Boards
Topic: Fast 32 bit GPIO possible on the STM32F4?
Replies: 8
Views: 248

Re: Fast 32 bit GPIO possible on the STM32F4?

The normal practice for LED matrix displays is to use external driver chips that are connected through serial interface to MCU. The driver chips provide the right voltage and current. Without them, you could have problems in the available source/sink current in the CPU and the wiring of the rquired ...
by Ollie
Mon Jun 05, 2017 7:12 pm
Forum: STM32F4 Boards
Topic: Fast 32 bit GPIO possible on the STM32F4?
Replies: 8
Views: 248

Re: Fast 32 bit GPIO possible on the STM32F4?

In your question, you did imply the answer. In STMF4, the ports are 16 bit wide. All the 16 pins can be written in a single assign statement. In similar way selected pins in the port can be set and/or cleared in a single assign statement. For 32 pin manipulation, you have to use two assign statement...
by Ollie
Sun Jun 04, 2017 8:16 pm
Forum: Welcome & FAQs
Topic: STM32 MCUs and the right pick
Replies: 19
Views: 628

Re: STM32 MCUs and the right pick

That is the nice code for state transition based decoding. I am using more brute force method on Teensy. Without doing analysis, my guess is that the brute force is faster. This code demonstrates how the performance counter (DWT_CYCCNT) is used for most accurate timing reference. void intENC1_A() { ...
by Ollie
Sun Jun 04, 2017 4:45 pm
Forum: Welcome & FAQs
Topic: STM32 MCUs and the right pick
Replies: 19
Views: 628

Re: STM32 MCUs and the right pick

@MiniMe, Indeed, I did use Teensy 3.2 for 2 motor control and Teensy 3.5 for 4 motor control. I couldn't use Teensy 3.6 because the DC motor driver (vnh2sp30) is using 5V logic and the level converters didn't work with 5 V non-tolerant pins - especially with the high current required for the frequen...
by Ollie
Sat Jun 03, 2017 5:04 pm
Forum: Welcome & FAQs
Topic: STM32 MCUs and the right pick
Replies: 19
Views: 628

Re: STM32 MCUs and the right pick

@MimiMe, It almost sounds like you are controlling 3 DC motors. In most cases, those motors can share the same frequency with individual pulse width control. If there are not too many other TIM users, you could dedicate a TIM for each motor for different frequencies. For the encoder interrupts, ther...
by Ollie
Fri Jun 02, 2017 7:27 pm
Forum: STM32F4 Boards
Topic: tiny stm32 F4 boards
Replies: 76
Views: 2281

Re: tiny stm32 F4 boards - size comparison

Here are two pictures to illustrate the sizes of STM32F745VGT6, the small flight controller STM32F407VET6, the handy blue board I am using in a multi-motor controller STM32F407VGT6, the nice black board for medium size vanilla applications https://2.bp.blogspot.com/-uEcyg4iq_-8/WTIKM9AokgI/AAAAAAAAC...
by Ollie
Wed May 31, 2017 3:29 am
Forum: Projects
Topic: MPU6050 and stm32f103c86
Replies: 4
Views: 263

Re: MPU6050 and stm32f103c86

Google is your friend. Here are some hints for the learning process. - Get a I2C scanner utility to learn the connected device addresses - Every I2C device has a lot of registers. They are explained in the device manuals - The integration of the angular speed gives the direction - Be aware of device...